开发者

Deploy as Jenkins User or Allow Jenkins To Run As Different User?

开发者 https://www.devze.com 2023-02-09 06:58 出处:网络
I\'m just getting started with Jenkins CI, and had a question which I\'m struggling to find answers for in the docs or online.Wonder if

I'm just getting started with Jenkins CI, and had a question which I'm struggling to find answers for in the docs or online. Wonder if someone might be able to offer some advice?

I'm attempting to use it to automatically deploy my dev and stage branches of my Django projects which are hosted on a Github organisation repository (ie, private). At the moment I have a user "django" who can access the Github repo via a Github deploy key. My Jenkins user can't access the repo. What's the开发者_C百科 best practice way of dealing with this - should I be creating an ssh deploy key for the "jenkins" user, or should I be getting Jenkins to run as my "django" user? I've seen mention if a HUDSON_USER in a newsgroup post, but I can't find reference to this in the docs.

Many thanks!

Ludo.


I have not worked with Github and so this answer may not apply at all, but we do use Jenkins and we use both CVS & Subversion for source control.

In our system, we use different username/password combinations for all three (Jenkins, CVS, Subversion), and it has had no adverse effects yet (it has been a year since we deployed Hudson - currently building 50+ projects).

As long as you can get Jenkins to access the repo using your github deploy key, you shouldn't have to change Jenkins to run as django, or create a jenkins user key for github. Personally, I would keep them separate.


Did you try this?

  1. Contact your OS admin team to grant to access to perform few operations on your version control using SUDO access.

  2. OR run the command using sudo -H -u <username> command parameters..

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号