Wednesday 2 March 2016

Part 3 -- Jenkins most frequent tasks: Bind Job to specific Jenkins slave

Sometimes you might need a specific environment to test your build. In this case using a slave to represent your required environments is almost a must.
In Jenkins, you can assign label to your server as an indicator of that specific environment. You can then ask Jenkins to run certain job on servers representing the environment.

Lets assume, you have a server with label "nodejs".



This is how you can bind certain job with this server

  1. Go to Jenkins --> "job name" --> configuration. 
  2. Check "Restrict where this job can be run".
  3. Add name of the label in textbox

  4. Save configuration. Next time, your job will run always on the server having label "nodejs". You can confirm it by going to console output of your job run.

No comments:

Post a Comment