I believe that you can define a JENKINS_HOME environment variable on the 
slave node. Jobs running there will use that instead of the JAVA_HOME of 
the master.

On Wednesday, February 1, 2017 at 4:48:52 PM UTC-5, Bruce Epstein wrote:
>
> Hi Everyone -
>
> I have one master and one slave node.
>
> I am trying to move some Jenkins jobs that currently run on the master to 
> instead run on the slave.
>
> For various reasons, I need (or at least want) to use the $JENKINS_HOME 
> env variable in my scripts, but it returns the value of the master jenkins 
> localtion, even when running a job on the slave.
>
> On the master node, $JENKINS_HOME  is 
> /opt/apache-tomcat-7.0.54/webapps/jenkins
>
> On the slave node, $JENKINS_HOME should be /opt/jenkins, but is being 
> returned as the master's value ( /opt/apache-tomcat-7.0.54/webapps/jenkins)
>
> For now, the best I have been able to do is climb up the directory 
> hierarchy, using something like:
>
> $WORKSPACE/../../../..
>
> So $WORKSPACE is returning the workspace location correctly on the slave, 
> but $JENKINS_HOME is returning the jenkins installation folder on the 
> master.
>
> Is this the expected behavior?
>
> Is there another env variable I should be using?
>
> Regardless, I have hundreds of Jenkins jobs, and tweaking them all will be 
> painful if I can't simply modify $JENKINS_HOME on which they currently rely.
>
> I think it is an IT configuration issue, because they say that when they 
> echo $JENKINS_HOME it gives the expected value on the slave node, as 
> follows:
>
> [jenkins@builder01-slave01 ~]$ echo $JENKINS_HOME
>
>
> /opt/jenkins
>
>  
>
> Maybe the Jenkins process was started as "root" and not as the "jenkins" 
> user, and they've defined $JENKINS_HOME for the wrong user?
>
> If it is an IT-related configuration and not a Jenkins thing, please give 
> advice and I'll rely it onto the IT dept, who control the server config.
>
>
> Thanks in advance 
> Cheers
> Bruce
>

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/6245bbe5-c448-420a-9f3b-f86cedc4a567%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to