【发布时间】:2019-04-06 21:32:58
【问题描述】:
如何在 Bitbucket 管道中使用 git 子模块?
我正在使用 Bitbucket 管道构建我的项目,但在拉入我的子模块时遇到问题,我可能没有正确配置 SSH 密钥。
我做了什么:
- 在我的计算机中创建了 SSH 密钥对。
- 在设置/SSH 密钥下的两个存储库(将运行构建的存储库和依赖存储库)中粘贴了相同的密钥对。
构建错误:
Submodule 'dependencies/my-dependency' (git@bitbucket.org:mycompany/my-dependency.git) registered for path 'dependencies/my-dependency'
Cloning into 'dependencies/my-dependency'...
Warning: Permanently added the RSA host key for IP address '18.205.93.2' to the list of known hosts.
Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
Clone of 'git@bitbucket.org:mycompany/my-dependency.git' into submodule path 'dependencies/my-dependency' failed
我的 yml 文件
image:
name: myuser/my-image-name
username: $DOCKER_HUB_USERNAME
password: $DOCKER_HUB_PASSWORD
email: $DOCKER_HUB_EMAIL
pipelines:
branches:
pipelines-setup:
- step:
script:
- git submodule update --init
【问题讨论】:
标签: git ssh git-submodules bitbucket-pipelines