Windows Slave Agent
Enable Launch Slave Agents via Java Web Start
From Jenkins home page, click to Manage Jenkins
Then click to Configure Global Security
Select Random for option TCP port for JNLP agents
Then finally click Save button
Add New Windows Slave
From Jenkins home page, click to Manage Jenkins
On Manage Jenkins page, scroll down and click to Manage Nodes
From there you can see all computer currently exist in system. We just have one master machine. To create new node, click to New Node
Input agent name and click to OK button
Input Remote root directory, select Launch agent via Java Web Start, Finally click to Save button
Launch Slave Agent
From computer which we want to install as slave ( for demo, I use same machine for both master and slave) access to link http://localhost:8080/computer/
You could see that currently Window_Agent is disconnected with Jenkins.
Click to Windows_Agent and then click to Launch button
File slave-agent.jnlp will be downloaded to local, copy this file to C:\jenkins_slave
Start a command prompt as administrator.
Change directory to C:\jenkins_slave then execute command javaws slave-agent.jnlp
A dialog will show up, click to Run button
A dialog will show up and message that connected successfully
Go back to link http://localhost:8080/computer/ and refresh, you will see Window_Agent up and running successfully.
Now WindowAgent ready for use. But we will do one more step to setting up slave agent as a Windows service. From **_Jenkins slave agent dialog, click to File and then select Install as a service**
Then click OK for question
Current dialog will close up and new service for slave agent is installed successfully.
From now on, everytime machine power up, this machine will automatically connect to jenkins master and ready for running job.
Running Job with Windows Slave Agent
From GOL job dashboard, click to Configure
From General tab, click to Restrict where this project can be run, then enter “WindowsAgent” in **_Label Expression. This mean we only want GOL job running on machine represented by “Windows_Agent” . Then finally click to Save **button.
Now try to run GOL from it’s dashboard by click on Build Now
From Jenkins home page, you could see GOL running with Windows_Agent machine