1

我试图让 Trellis 的部署脚本在 Bitbucket 管道构建中运行,但该脚本无法访问 Git 存储库。

输出以下错误:

TASK [deploy : Remove untracked files from project folder] *********************
ok: [xx.xx.xx.xx]
TASK [deploy : Failed connection to remote repo] *******************************
System info:
  Ansible 2.8.8; Linux
  Trellis Head
---------------------------------------------------
Git repo git@bitbucket.org:xxx/yyy.git cannot be accessed. Please
verify the repository exists and you have SSH forwarding set up correctly.
More info:
> https://roots.io/trellis/docs/deploys/#ssh-keys
> https://roots.io/trellis/docs/ssh-keys/#cloning-remote-repo-using-ssh-
agent-forwarding

存储库与运行管道的(私有)存储库相同。我已将管道的 SSH 密钥添加到存储库的访问密钥中。当我运行ssh -T git@bitbucket.org它时,它确认 SSH 密钥具有对 repo 的读取权限。

我的管道配置是:

pipelines:
  branches:
    master:
      - step:
          name: First Step
          image: misterio92/ci-php-node:3.0
          caches:
            - composer-bedrock
            - composer-sage
            - node-sage
          script:
            - cd $BITBUCKET_CLONE_DIR/trellis && echo $VAULT_PASS > .vault_pass
            - apt-get update -qy
            - apt-get install -y python-dev python-pip
            - chmod 700 /opt/atlassian/pipelines/agent/build
            - chmod 700 /opt/atlassian/pipelines/agent/build/trellis
            - cd $BITBUCKET_CLONE_DIR/trellis && pip install -r requirements.txt
            - cd $BITBUCKET_CLONE_DIR/trellis && ansible-galaxy install -r galaxy.yml
            - cd $BITBUCKET_CLONE_DIR/trellis && ./bin/deploy.sh production prod.url.com --vault-password-file .vault_pass --inventory hosts/production
4

0 回答 0