JNLP(JAVA NETWORK LAUNCH PROTOCOL) is used to Connect to/launch your java application( here Jenkins) from a remote location.
In order to setup a windows-slave agent you need to first Enable the JNLP Agents :
To set-up the Windows-slave agent:
-
Go to Manage Jenkins -> Manage Nodes ->click on New Node -> Enter the node name -> Select permanent agent.
-
Enter a sample description and the no of executors (ie. no of jobs you want to run parallely on windows),here I have given 1 executor.
-
Also specify the remote root directory which will act as the default jenkins workspace on the slave agent (F:\jenkins_remotedirectory is my remote root workspace on windows).
-
Give a label and for launch method ->select launch agent by Connecting it to the master since we are configuring a windows slave (launch agents via ssh is for linux machines).
-
Click on Save.
-
We have configured the slave machine but haven't launched the agent yet.
-
In order to run any jenkins job on the master we had installed certain dependencies like Git (for source code management), JDK and Maven (for building the jobs).
-
Similarly we need to download and install those dependency tools on our windows-slave (including setting the environment variables for JAVA_HOME and MAVEN_HOME).Test whether the tools are aptly configured and installed and mention the tool locations by specifying their paths in the windows-slave machine.
-
Next step is to connect the slave agent with the master. You can either do this by clicking on the launch button or you can do it via command line by executing the command that is mentioned.
-
Here I decide to launch the connection via command line.For this I have to first download the agent.jar file and paste it in my remote root directory that I have specified as workspace for windows-slave(F:/jenkins_remotedirectory). And then from the remote root directory in command prompt of my slave agent I need to run the specified command.
- NOTE: The IP address of the jenkins master could be some random IP. You need to specify the IP of your machine on which Jenkins master is configured.
- Now the widows-slave is successfully configured and launched as shown below:
- The widows-slave agent is now functional and the master can delegate any job to the slave agent node.