I have Jenkins installed in Linux and I want to run the build(s) under a user.
Not just a simple user, but one that belongs to the list of user that access the linux machine and that belongs to a certain group as it has privileges to modify/create files under a certain folder.
I have read somewhere that you can set the variable $JENKINS_USER but I do not know where and how. Thank you for your time
P.S. I did some research all the questions posted are similar but not the same as this one
Please if I am not clear read this: Usually Jenkins execute the build using a user called jenkins, now I want to be able to use a different user (pre-existing).
Yes, it is necessary to set JENKINS_USER variable, but in another file.
Look here http://blog.manula.org/2013/03/running-jenkins-under-different-user-in.html
Have a look at the Started-By Environment Variable plugin.
https://wiki.jenkins-ci.org/display/JENKINS/Started-By+Environment+Variable+Plugin
EDIT:
If you are just asking how to set up Jenkins to run under a different user in Linux it depends on how you installed it. I never set up Jenkins on Linux yet (but I can use google). Have a look at https://wiki.jenkins-ci.org/display/JENKINS/Installing+Jenkins for different setup options. I had a look at Installing Jenkins as a Unix daemon and at step 7 you need to setup a configuration file. Change the last line in that file (RUN_AS_USER=jenkins
) to contain the user of your choice.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With