繁体   English   中英

在 gitlab 运行器中克隆 git 存储库

[英]clone git repository in gitlab runner

我需要有关 gitlab 跑步者的帮助。 我需要克隆另一个启动运行器的 gitlab 存储库。

例如: CI runner runner-repo-arepo -a 中执行,我需要在runner-repo- a 中克隆repo-b

我现在有:

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 密钥,一旦完成,参考 了解如何将rsaxxxx.pub添加到 GitLab 中。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM