如何使用Bitbucket管道对包括供应商文件夹的PHP代码进行FTP [英] How to ftp php code including vendor folder using bitbucket pipeline

查看:55
本文介绍了如何使用Bitbucket管道对包括供应商文件夹的PHP代码进行FTP的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在bitbucket中有php项目。
我能够安装composer并使用管道生成供应商文件夹。
当前,没有单元测试用例。因此,没有添加脚本来执行测试用例。
此外,我需要将文件和供应商文件夹ftp到我的服务器。下面是当前的bitbucket-pipeline.xml

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/

我被阻止了:

使用 git ftp push将仅从最后一次提交。
如何也通过FTP供应商文件夹?完整的文件夹需要是ftp。该文件夹是在执行管道脚本时生成的。

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.

赞赏任何输入!

推荐答案

我有同样的问题。为了同时部署供应商目录,只需将其从.gitignore中删除,将其添加到您的项目中即可提交。管道将捕获它并部署为普通目录。

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.

这篇关于如何使用Bitbucket管道对包括供应商文件夹的PHP代码进行FTP的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆