【问题标题】:Grant access to gitlab-ci runners授予对 gitlab-ci 运行器的访问权限
【发布时间】:2016-10-06 16:42:00
【问题描述】:

我在 gitlab 中有 2 个项目。出于示例目的,我们将它们称为 foo/mainfoo/dep

foo/main 中,我正在使用 gitlab-ci 和在另一台机器上运行的 docker-runner 来执行自动化测试和构建。

由于 foo/depfoo/main 的依赖项,我需要在构建 main 时 git clone 它。

两个存储库都是私有的/访问受限。

如何将 docker-runner 的访问权限授予其他存储库?

目前我收到一个:

npm ERR! Host key verification failed.
npm ERR! fatal: Could not read from remote repository.
npm ERR! 
npm ERR! Please make sure you have the correct access rights
npm ERR! and the repository exists.

【问题讨论】:

    标签: gitlab gitlab-ci gitlab-ci-runner


    【解决方案1】:

    正如GitLab CI runner - can't access other repository 所述,您可以通过gitlab-runner/config.toml 将自己的 .ssh-keys 暴露给 docker-container。

    我希望这不是唯一的解决方案,因为将密钥暴露给任何人推送到 repo 中的东西可能是不安全的。

    【讨论】:

      【解决方案2】:

      单击您的个人资料图片下方项目容器右上角的Settings。然后选择Deploy Keys 部分并将您的计算机ssh public key 添加到项目中。 有关生成ssh key 的更多信息,请参阅https://www.digitalocean.com/community/tutorials/how-to-set-up-ssh-keys--2

      【讨论】:

      • 这仍然需要所有运行 ci 的机器第一个:有一个私钥,第二个:将该私钥公开给 docker-container。和我的答案一样
      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-12-20
      • 2021-02-25
      • 2018-09-04
      • 2016-07-10
      相关资源
      最近更新 更多