push from bitbucket repository to shared hosting ftp server

孤街浪徒 提交于 2019-12-02 19:33:20

You can use the new bitbucket tool, Pipelines! Configure a new pipeline file:

    image: samueldebruyn/debian-git
      pipelines:
      default:
        - step:
          script:
            - apt-get update
            - apt-get -qq install git-ftp
            - git ftp init --user $FTP_USERNAME --passwd $FTP_PASSWORD ftp://server/public_html/

Before you commit, create the environment variables $ FTP_USERNAME and $ FTP_PASSWORD in settings -> environment variables.

For the push edit the source code and change the "init" to "push" and commit to replace the file on your shared server.

For more information watch this video: https://www.youtube.com/watch?v=8HZhHtZebdw

This question is ages old. However, I am replying to the question in hopes of anyone else looking for a solution to this.

You can use the FTP Deployment PHP Script provided by BitBucket.

If you need FTPS explicit, in the functions.inc.php where you upload the above code, replace this line:

$conn_id = ftp_connect($ftp_host);

With the below:

// set up basic ssl connection
$conn_id = ftp_ssl_connect($ftp_host);

This should get you all set to use this script with explicit SSL-FTP connection instead of plain text FTP.

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