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

0 votes
I have the working /.jenkins folder under a specific user in home on Linux. I want to start Jenkins with another user. How can I do this?
Jul 19, 2018 in Jenkins by Nilesh
• 6,880 points
357 views

2 answers to this question.

0 votes

I think this can help you out.

Set an Environment Variable JENKINS_HOME pointing to the .jenkinsfolder 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
answered Jul 19, 2018 by Kalgi
• 2,620 points
0 votes

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.

answered Aug 7 by Sirajul
• 36,020 points

Related Questions In Jenkins

0 votes
3 answers

How can I make Jenkins CI with Git trigger on pushes to master?

To automatically run build on code commit, follow ...READ MORE

answered Aug 7 in Jenkins by Sirajul
• 36,020 points
225 views
0 votes
2 answers

How do i move jenkins from one server to another?

1. Copy all the files in your JENKINS_HOME directory over ...READ MORE

answered Aug 2 in Jenkins by Sirajul
• 36,020 points
1,910 views
0 votes
1 answer

Jenkins and Docker: How can I customize my jenkins pipeline to use docker?

Jenkins Pipeline is designed to easily use ...READ MORE

answered Aug 26 in Jenkins by Sirajul
• 36,020 points
323 views
0 votes
1 answer

How can I create global macros and templates in jenkins job builder?

you can append the path to the ...READ MORE

answered Apr 2, 2018 in Jenkins by ajs3033
• 7,280 points
350 views
+13 votes
2 answers

Git management technique when there are multiple customers and need multiple customization?

Consider this - In 'extended' Git-Flow, (Git-Multi-Flow, ...READ MORE

answered Mar 26, 2018 in DevOps & Agile by DragonLord999
• 8,380 points
205 views
0 votes
1 answer
0 votes
1 answer

How do I pass value from my Fake # script to the host build server (Jenkins)

You can use the EnvInject plugin to pass environment ...READ MORE

answered Jul 11, 2018 in Jenkins by Kalgi
• 2,620 points
103 views
0 votes
1 answer

How Can I measure Jenkins Build Performance?

If you go to the Jenkins page ...READ MORE

answered Jul 16, 2018 in Jenkins by Kalgi
• 2,620 points
81 views