在 git 实验室运行器中克隆 git 存储库

clone git repository in gitlab runner

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

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

现在我有:

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 协议。一种更简单的方法是只使用 git clone.

SSH 版本

您需要在要克隆的机器上生成一个 SSH 密钥,并将该密钥添加到 GitLab 中。请参考 this to generate SSH Key , once that is done, refer this 了解如何将 rsaxxxx.pub 添加到 GitLab。