我有一个运行良好的 bitbucket 管道,但现在在一个项目中,我需要从私有存储库中提取,其中包含我的composer.json 中所需的包。
当我在管道中执行
composer install
时,它会因此错误而停止
Failed to execute git clone --no-checkout '[email protected]:company/package.git' [...]
Cloning into '/opt/atlassian/pipelines/agent/build/vendor/company/package'...
Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
管道没有定义任何 SSH 密钥,因此不允许拉取,但由于它是短暂的,我如何定义它?
或者也许我应该另外定义需求?
.ssh
目录。这应该足以让它运行。
此外,我刚刚看到现在(也许这是新的,但我不确定)有一个新页面“设置”>“管道”>“SSH 密钥”用于管理管道 SSH 密钥。这样,您甚至不需要将私钥添加到您正在使用的 docker 镜像中。但我到目前为止还没有使用过,所以我不能说什么。