How to ftp php code including vendor folder using bitbucket pipeline

一世执手 提交于 2019-12-13 03:43:52

问题


I have php project in bitbucket. I am able to install composer and generate vendor folder using pipeline. Currently, there are no unit test cases. Hence, no script added to execute test cases. Further, I need to ftp files and vendor folder both to my server. Below is current bitbucket-pipeline.xml

image: php:7.2.0

pipelines:
  default:
    - step:
        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
          - cd src
          - composer install

Following is suggested to push files but this is supposed to push only changed files.

- apt-get -qq install git-ftp
- git ftp push --user $FTP_USERNAME --passwd $FTP_PASSWORD ftp://YOUR_SERVER_ADDRESS/PATH_TO_WEBSITE/

I am blocked over:

Using "git ftp push" will only push changed file from last commit. How to ftp vendor folder as well? Complete folder needs to be ftp. This folder is generated while executing pipeline script. Its not checked in repository.

Any input is appreciated!


回答1:


i had same issue. In order to deploy vendor dir as well, just remove it from .gitignore , add it to you project commit it. pipelines will catch it and deploy as normal directory.



来源:https://stackoverflow.com/questions/48130876/how-to-ftp-php-code-including-vendor-folder-using-bitbucket-pipeline

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!