Wednesday, May 18, 2022

Setup Slave server for Jenkins

Description:  Here I have explained, How to setup Slave server for Jenkins on Ubuntu Machine

Setup:

  1. Master Jenkins : localhost
  2. Slave Machine : 3.90.0.161
Before setup slave server for jenkins, I am going set password for ubuntu user and create one folder for slave jenkins file. In this example I used /var/jenkins











Install java in slave Jenkins server using below command

# apt install java-jre
 

After create user and jenkins directory on slave, Open jenkins url navigate to Manage Jenkins --> Manage Node and Cloud --> New Node








































After click on create button fill all the require details like name, Remote Directory, Usage, Launch Method, Host and credentials of slave machine.

Note: Host key Verification Strategy set : Non Verifying Verification Strategy




















After fill all the details click on launch the agent, wait for some time. You will get output as follow


















Now, I am creating one Free style project and check for the slave usage



















In project, I have defined execute shell method under build as follow. It will show message Test Slave and run for 25 Seconds to validate the stage

echo "Test Slave"
sleep 25






















Now I am going to save and build the job. Here you can see job executed from slave as follow




Also we can check output in console of the project as follow


No comments:

Post a Comment