Simple question: How to change the jenkins home directory location? By default it points to /var/lib/jenkins
whereas I want it to point to /home/jenkins
. I have changed my $JENKINS_HOME
to /home/jenkins
but it doesn't help me.
相关问题
- 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
- Build errors of missing packages in Visual Studio
- Jenkins Not Outputting Junit Report Info From File
To change the Jenkins home directory you just need to setup the "JENKINS_HOME" environment variable to point to the new location. You can also set the JENKINS_HOME as a system property or a JNDI environment entry as explained in the documentation.
Jenkins Documentation
I tried setting the PATH thing but it doesn't seem to work as it probably has to be under Jenkins user which does not have a real unix user account. I found the variable also accessible in /etc/sysconfig/jenkins which did the trick when I restarted Jenkins.
Jenkins usually runs with its own user,
so changing the home-dir of that user should do the job.
If not sure, simply run a test-job with a shell-command like 'id' or 'whoami' or 'env' to find the user that Jenkins uses.
Also, note that a message of "
Started by user anonymous
" does not mean that Jenkins started as an anonymous user -please see this related answers by Sagar and Peter Tran:
how to run jenkins as a different user
For me on Jenkins 2.7.2 on RHEL 7.2 after already starting jenkins and configuring a build, I needed to:
1) Change the jenkins user's home directory
2) Change the setting in the start script to also find it
3) Copy all the data to the new location (eg: /home/jenkins)
4) Start it back up
And that seems to have done it for me.