在gitlab runner中克隆git存储库
我需要关于gitlab runner的帮助。我需要克隆另一个启动runner的gitlab存储库 例如:CI runnerrunner-repo-a在repo-a中执行,我需要在runner-repo-a中克隆repo-b 现在我有:在gitlab runner中克隆git存储库,gitlab,gitlab-ci,gitlab-ci-runner,Gitlab,Gitlab Ci,Gitlab Ci Runner,我需要关于gitlab runner的帮助。我需要克隆另一个启动runner的gitlab存储库 例如:CI runnerrunner-repo-a在repo-a中执行,我需要在runner-repo-a中克隆repo-b 现在我有: GO_CHEF: git.developers.mycompany.com/chef/myrepo-chef-repo.git [...] Update databags: stage: update script: - git config --
GO_CHEF: git.developers.mycompany.com/chef/myrepo-chef-repo.git
[...]
Update databags:
stage: update
script:
- git config --global url."https://gitlab-ci-token:${CI_JOB_TOKEN}@git.developers.mycompany.com:".insteadOf "https://git.developers.mycompany.com"
- go get -u ${GO_CHEF}
这就是错误:
package git.developers.mycompany.com/chef/myrepo-chef-repo.git: cannot download,
git://git.developers.mycompany.com/chef/myrepo-chef-repo uses insecure protocol
关于,此错误可能是由于您的环境中使用了
https
协议。一种更简单的方法是只使用SSH
版本的git clone
您需要在要从中克隆的机器中生成SSH密钥,并将该密钥添加到GitLab中。请参阅生成SSH密钥,完成后,请参阅了解如何将
rsxxxx.pub
添加到GitLab中。此错误可能是由于使用的https
协议造成的。请尝试SSH
版本的git clone
@mdabdullah我收到此错误:“远程:不允许您从此项目下载代码。致命:无法访问“”:请求的URL返回错误:403 package git.developers.mycompany.com/chef/myrepo-chef-repo:exit status 128”是403是用户密码/授权错误。您需要在进行克隆的机器中生成一个SSH密钥,并将该密钥添加到GitLab中。请参考此项以生成SSH密钥https://www.ssh.com/ssh/keygen/
,完成后,请参阅此部分以了解如何将rsaxx.pub
添加到GitLabhttps://www.tutorialspoint.com/gitlab/gitlab_ssh_key_setup.htm
但是您是否需要在gitlab runner中生成并添加ssh密钥来克隆其他存储库???是的,它正在工作。感谢@mdabdullah对您的支持:)