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

问题描述 投票:1回答:1

我正在尝试使用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

但它忽略了供应商文件夹。我假设,工件也将添加此文件夹以进行部署。

有什么不对或我能做得更好?

php deployment composer-php bitbucket bitbucket-pipelines
1个回答
0
投票

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

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

© www.soinside.com 2019 - 2024. All rights reserved.