Push to GitLab repository within CI server (deploy keys)

99封情书 提交于 2020-01-02 03:17:09

问题


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?


回答1:


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).


来源:https://stackoverflow.com/questions/17914485/push-to-gitlab-repository-within-ci-server-deploy-keys

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!