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

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

问题描述

GitLab具有这种很好的'部署密钥'功能,可用于CI服务器读取和拉取存储库,因为它们通常不需要更多。但是,我需要创建标签并将其推送到存储库,以标记从master分支构建的每个发行版。

更具体地说,我有一个Jenkins每次构建触发时都会从主分支构建发行版本。如果工作成功,我想用发行号为'master'分支标记以备将来参考。



我相信我不能用'部署密钥功能。那么,我该如何去做和做到这一点?我不知道我可以创建一个额外的用户,只是为了这个,并让他访问该项目...导致每个使用GitLab访问的用户都与LDAP绑定。



任何建议?

解决方案

这是正确的一个部署密钥不(不会)项目(如 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?

解决方案

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天全站免登陆