1
votes

according to the jenkins wiki

/var/jenkins/bin/launch-slave is a shell script that Jenkins uses to execute jobs remotely. This shell script sets up PATH and a few other things before launching slave.jar. Below is a very simple example script

I'm running jenkins as JNLP and don't have a /bin, so I'm not sure where should i put this file

2
Was any of the answers helpful?malenkiy_scot

2 Answers

0
votes

Run Jenkins 'headlessly', not via a browser:

java -jar slave.jar -jnlpUrl http://[jenkins_server]/computer/[slave-name]/slave-agent.jnlp

Write a script containing that command and add whatever else you want before it, including setting the new PATH.

You can also specify environment variables (or 'key-value pairs') in the slave node configuration. Navigate to http://[jenkins_server]/computer/[slave-name]/configure and check off 'Environment Variables' check-box.

0
votes

The script on Jenkins wiki you refer to is meant as an example for those who want to use slaves of type "Launch slave by executing a command on master". If you are using JNLP type slaves, then you don't need this script.

What you need to do is log onto the slave machine, open the web browser to your Jenkins, navigate to the page of your slave and hit the orange button. Or use one of the command lines on the page to run the slave.