How can I point Jenkins to another .jenkins home directory?

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

<?xml version="1.0" encoding="UTF-8"?>
<Context docBase="/home/enomad/projects/jenkins/jenkins-master/war/target/jenkins" path="" reloadable="true">
 <Environment name="JENKINS_HOME" value="/home/enomad/projects/jenkins-home"
         type="java.lang.String" override="false"/>
</Context>

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!


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
export JENKINS_HOME=/usr/jhon/.jenkins

java -jar jenkins.war


The batch should be like
  SET JENKINS_HOME=C:\users\jhon\.jenkins

 java -jar jenkins.war


The Powershell should be like
[Environment]::SetEnvironmentVariable("JENKINS_HOME", "${PWD}\.jenkins")
java -jar jenkins.war

This will set your home directory to the current-working-directory + './jenkins'

Tags:

Jenkins