Run Jenkins jobs on Linux under a User

后端 未结 3 1504
醉梦人生
醉梦人生 2021-01-01 12:41

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

3条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-01-01 13:28

    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.

提交回复
热议问题