Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
708 views
in Technique[技术] by (71.8m points)

composer php - How to ftp php code including vendor folder using bitbucket pipeline

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!

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...