0

我想在 bitbucket 管道中提交。

我的 YAML 文件:

image: wagnerstephan/bitbucket-git-ftp:latest

pipelines:
  custom:
    init:
    - step:
        script:
          - apt-add-repository ppa:ondrej/php
          - apt-get update
          - apt-get install php7.0 -y
          - php build/build.php
          - git add .
          - git commit -m "Minify"
          - git ftp init -vv --insecure -u "$FTP_USERNAME" -p "$FTP_PASSWORD" "ftp://$FTP_HOST"
    deploy:
    - step:
        script:
          - apt-add-repository ppa:ondrej/php
          - apt-get update
          - apt-get install php7.0 -y
          - php build/build.php
          - git add .
          - git commit -m "Minify"
          - git ftp push -vv --insecure -u "$FTP_USERNAME" -p "$FTP_PASSWORD" "ftp://$FTP_HOST" --all
  branches:
    master:
    - step:
        name: Deploy production
        deployment: production
        script:
          - apt-add-repository ppa:ondrej/php
          - apt-get update
          - apt-get install php7.0 -y
          - php build/build.php
          - git add .
          - git commit -m "Minify"
          - git ftp push -vv --insecure -u "$FTP_USERNAME" -p "$FTP_PASSWORD" "ftp://$FTP_HOST"

build.php缩小所有 JS 和 CSS 文件。

第一步(git init)运行没有问题,.git-ftp.log文件被创建。

但是下一个主推运行,(git ftp push ...命令)它写道:

Thu Mar 19 21:13:00 UTC 2020: Last deployed SHA1 for ftp.[my_ftp].com/ is 23ec1b6f290ff9dd11d5ff700718ed121c54709c.
Thu Mar 19 21:13:00 UTC 2020: Unknown SHA1 object, make sure you are deploying the right branch and it is up-to-date.
Do you want to ignore and upload all files again? [y/N]: Thu Mar 19 21:13:00 UTC 2020: Aborting...

好像最新的提交 ID 不好。

4

0 回答 0