Bitbucket 管道部署忽略使用 ftp 上传的供应商文件夹

Haj*_*jan 3 php deployment bitbucket composer-php bitbucket-pipelines

我正在尝试使用 bitbucket 管道部署 PHP 项目。有了这个代码:

init: # -- First time init
  - step:
      name: build
      image: php:7.1.1
      caches:
        - composer
      script:
        - apt-get update && apt-get install -y unzip
        - curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
        - composer install
        - vendor/bin/phpunit
      artifacts: # defining vendor/ as an artifact
        - vendor/**
  - step:
      image: samueldebruyn/debian-git
      name: deployment
      script:
        - apt-get update
        - apt-get -qq install git-ftp
        - git ftp init -u "$FTP_DEV_USERNAME" -p "$FTP_DEV_PASSWORD" ftp://$FTP_DEV_HOST/$FTP_DEV_FOLDER
Run Code Online (Sandbox Code Playgroud)

但它忽略了供应商文件夹。我假设,工件也会添加此文件夹来部署。

有什么问题或者我可以做得更好吗?

Sve*_*ort 5

发生这种情况是因为您可能有一个.gitignore包含该vendor目录的目录。这些工件实际上由 bitbucket 传递到下一步,但被 git-ftp 忽略。为了使用 git-ftp 上传这些文件,您需要创建一个名为的文件,.git-ftp-include您需要在其中添加以下行:!vendor/如文档!中所述,这是必需的:

.git-ftp-include 文件指定 Git-ftp 应上传的有意未跟踪的文件。如果您有一个应始终上传的文件,请添加以 ! 后跟文件名。