2
votes

On an ubuntu jenkins master I have configured that gradle should be autoinstalled to:

GRADLE_HOME: /var/jenkins/tools/mygradle

enter image description here

As a result gradle is installed here on all ubuntu slaves:

/var/jenkins/tools/mygradle/bin/gradle 

This works fine and my gradle jobs builds on the slave nodes.

Now I need to call a .sh script (Build step - Execute shell) in a job. At some point the script calls gradle and therefore requires that its in the PATH. But when I execute the job (on one of the build slaves) gradle cannot be found.

Is it possible to auto install gradle on all slaves and ALSO add gradle to the PATH on all slaves?

All slaves are launched using Launch slave agents on unix Machines via SSH

1
What method do you use to launch your slaves ? The way to set your PATH would vary depending on that. - gareth_bowles

1 Answers

1
votes

This works:

https://wiki.jenkins-ci.org/display/JENKINS/Tool+Environment+Plugin

at least for now. The downside is that it must be configured for each job.