问题
I Installed jenkins using a guide, and that guide created a "jenkins" user in the server and apparently runs the jenkins server under it.
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.
回答1:
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
Reference
来源:https://stackoverflow.com/questions/49634565/run-jenkins-job-as-another-user