Как разрешить сценарию Trellis Deploy для клонирования частного удаленного репо во время конвейера Bitbucket? - PullRequest
1 голос
/ 04 марта 2020

Я пытаюсь запустить сценарий развертывания Trellis внутри сборки Bitbucket Pipeline, но сценарий не может получить доступ к репо 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

Репо - это то же самое (частное) репо, в котором работает конвейер. Я добавил ключ S SH конвейера к ключам доступа репо. Когда я запускаю ssh -T git@bitbucket.org, это подтверждает, что ключ S SH имеет доступ для чтения к репо.

Моя конфигурация конвейера:

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
...