以另一个用户身份运行jenkins作业 [英] Run jenkins job as another user
问题描述
我使用指南安装了jenkins,该指南在服务器中创建了一个"jenkins"用户,并且显然在其下运行jenkins服务器.
I Installed jenkins using a guide, and that guide created a "jenkins" user in the server and apparently runs the jenkins server under it.
我在服务器上的所有设置(虚拟环境,python软件包安装)均针对其他用户("ci-user").我有什么办法可以以"ci_user"而不是"jenkins"的身份运行我的工作?我想避免为詹金斯"用户再次进行所有设置.
All my setup on the server (virtual env, python package installations) is for a different user ("ci-user"). Is there any way for me to run my jobs as "ci_user" instead of as "jenkins"? I'd like to avoid doing all the setup again for the "jenkins" user.
推荐答案
etc/default/jenkins
文件中有JENKINS_USER
变量.您可以将其更改为ci_user,然后需要更改几个文件夹的所有权并重新启动计算机.
There is JENKINS_USER
variable in etc/default/jenkins
file. You could change it to ci_user, then you will need to change the ownership of several folders and reboot the machine.
chown -R ci_user /var/lib/jenkins
chown -R ci_user /var/log/jenkins
chown -R ci_user /var/cache/jenkins
这篇关于以另一个用户身份运行jenkins作业的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!