推送到 CI 服务器中的 GitLab 存储库(部署密钥) [英] Push to GitLab repository within CI server (deploy keys)

查看:25
本文介绍了推送到 CI 服务器中的 GitLab 存储库(部署密钥)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

GitLab 有这个很好的部署密钥"功能,它有助于 CI 服务器读取和拉取对存储库的访问权限,因为它们通常不需要更多.但是,我需要创建一个标签并将其推送到存储库,以标记从主"分支构建的每个版本.

更具体地说,我有一个 Jenkins 工作,每次触发构建时都会从主"分支构建一个发布版本.如果作业成功,我想用发布号标记master"分支 HEAD 以供将来参考.

我相信我无法使用部署密钥"功能执行此操作.那么我该怎么做呢?我不确定我是否可以为此创建一个额外的用户,并授予他对项目的访问权限...因为每个具有 GitLab 访问权限的用户都与 LDAP 相关联.

有什么建议吗?

解决方案

2017 年更新:从 GitLab 8.16(2017 年 1 月)开始,

<小时>

原始答案(2013 年):正确的部署密钥没有(也不会)对项目具有写入权限(如 issue 2134).

剩下的就是:

  • 创建一个 LDAP 通用帐户(如果这些帐户在您的组织中获得授权)
  • 在单独的 LDAP 服务器中创建一个虚拟帐户(但 gitlab omniauth-ldap 不支持多个 LDAP 声明).

GitLab has this nice 'deploy keys' feature useful for CI servers to have read and pull access to a repository as they usual don't need more than that. However, I need to create and push a tag to the repository to tag each release that is built from the 'master' branch.

To be more specific, I have a Jenkins job that will build a release version from the 'master' branch every time a build is triggered. If the job is successful, I want to tag the 'master' branch HEAD with the release number for future reference.

I believe I can't do this using the 'deploy keys' feature. So how do I go about and do this? I'm not sure I can create an extra user, just for this, and give him access to the project... Cause every user with GitLab access is tied to LDAP.

Any suggestions?

解决方案

Update 2017: since GitLab 8.16 (January 2017), and issue 1376, you now can add deploy keys with write-access.


Original answer (2013): It is right a deploy key don't (and won't) have write access to a project (as mentioned in issue 2134).

That leaves you with:

  • creating an LDAP generic account (if those accounts are authorized in your organization)
  • creating a dummy account in a separate LDAP server (but the gitlab omniauth-ldap doesn't support multiple LDAP declaration).

这篇关于推送到 CI 服务器中的 GitLab 存储库(部署密钥)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆