如何在 Bitbucket Pipelines 中通过 atlassian/ftp-deploy:0.2.0 仅部署更改的文件?

sno*_*bik 6 ftp bitbucket bitbucket-pipelines

我是 BitBucket 管道的新手,因为我使用 Webhook 将我的更改部署到 FTP。

我已经设置了 reccommended atlassian/ftp-deploy:0.2.0 管道并且它工作正常,但我想设置只获取更改的文件并将其发送到 FTP。

image: node:10.15.3

pipelines:
  default:
    - step:
        name: FTP Deploy
        script: # Modify the commands below to build your repository.
          - pipe: atlassian/ftp-deploy:0.2.0
            variables:
              USER: 'myFTPusername'
              PASSWORD: 'myFTPpass'
              SERVER: 'myFTPserver'
              REMOTE_PATH: 'myFTPpath'
    - step:
        name: Deploy message
        deployment: test
        script:
          - echo "Deploying to main environment"
Run Code Online (Sandbox Code Playgroud)

任何帮助如何设置它以便它只将更改的文件发送到 FTP?

预期输出是bitbucket-pipelines.yml 的代码

e-i*_*ael 1

atlassian/ftp-deploy:0.3.6删除所有文件,我发现这个图像wagnerstephan/bitbucket-git-ftp:latest非常有用,轻便且运行良好并且仅更新已更改的文件。

第一个管道将运行时出现错误,因此选择commit然后使用所选选项再次运行管道init

image: wagnerstephan/bitbucket-git-ftp:latest

pipelines:
  custom:
    init:
    - step:
        script:
          - git reset --hard
          - git ftp init -u "$FTP_USERNAME" -p "$FTP_PASSWORD" ftp://$FTP_HOST/
    deploy:
    - step:
        script:
          - git reset --hard
          - git ftp push -u "$FTP_USERNAME" -p "$FTP_PASSWORD" ftp://$FTP_HOST/--all
  branches:
    develop:
      - step:
          name: Deploy Develop
          deployment: develop
          script:
           - git reset --hard
           - git ftp push -u "$FTP_USERNAME" -p "$FTP_PASSWORD" ftp://$FTP_HOST/
    master:
    - step:
        name: Deploy production
        deployment: production
        script:
          - git reset --hard
          - git ftp push -u "$FTP_USERNAME" -p "$FTP_PASSWORD" ftp://$FTP_HOST/
Run Code Online (Sandbox Code Playgroud)

注意:检查 Bitbucket 存储库中的环境名称。