I have the working /.jenkins folder under a specific user in home on Linux. I want to start Jenkins with another user, but re-use the .jenkins folder of the other user. How can I do this? Jenkins offers some instructions but I don't get it :)
相关问题
- Jenkins - cmd is not recognized
- When using Nokogiri, how do you suppress the inser
- Where Jenkins stores plugin configuration
- Multi-branch configuration with externally-defined
- How to start pm2 website using jenkins on AWS ubun
相关文章
- dotnet restore还原nuget包时无法加载 https://api.nuget.org/
- jenkins在window集群环境中如何部署自动化发布?
- jenkins + Publish over FTP 自动部署前端React项目
- jenkins自定打包部署React前端项目遇到的问题。
- Best way to manage docker containers with supervis
- Access BitBucket payload data in Jenkins pipeline
- Jenkins Not Outputting Junit Report Info From File
- Intermittent “SVNException: svn: E175002: Connecti
I think this can help you out.
Set an Environment Variable
JENKINS_HOME
pointing to the.jenkins
folder and run the Jenkins command.The shell should be like
The batch should be like
The
Powershell
should be likeThis will set your home directory to the
current-working-directory + './jenkins'
In Tomcat 5 you can modify tomcat.conf and add the path:
export JAVA_OPTS="-DJENKINS_HOME=/home/jenkins"
Restart Jenkins.
I am using jenkins 1.639 as a war deployed on tomcat 7.0.67 . My JENKINS_HOME is set to /home/hims/jenkins
This is the entry of my setenv.sh file under /tomcat/bin directory
export CATALINA_OPTS="-DJENKINS_HOME=/home/hims/jenkins"
I hope this helps.
Here are the options you have:
a) Assuming you're deploying Jenkins into Tomcat,you can do the following:
In your catalina.home/conf/localhost/jenkins.xml
b) You can export the JENKINS_HOME=toWhateveryouwant as mentioned by Harsha in the previous post
c) You can extend your JAVA_OPTS params and add -DJENKINS_HOME=/path/to/jenkins_home/ as described here: Jenkins Mailing list
Good luck!
Usually, you need to set the permissions for those files to be accessed by the new user.
See here: How to run jenkins as a different user -
especially the answers of Sagar and Peter Tran .
Cheers
Or you can modify the .bashrc so that it sets the environment variable everytime you start a console, that is, if you are using bash to start Jenkins.