CI with Jenkins: how to force building happen on slaves instead of master?
Asked Answered
D

4

14

I am using Jenkins for CI, I have a master and two slaves, master is running Jenkins and I want only slaves doing the actual building task, is there anywhere I can configure this? I know there is an 'executor', if I change it to 0 on master, probably master won't build anything, but is there any proper way to do this?

Dartboard answered 19/12, 2012 at 6:47 Comment(0)
P
20

You can set where a job will be run using the "Restrict where this project can be run" option in your job. This setting can be used together with tags you have added to your slaves.

For example two slaves having the tag "Linux-buildserver" and using that tag will split the job up on those two slaves. Setting the IP-address as a tag in the job will make sure only that buildserver / slave is used.

Photodisintegration answered 19/12, 2012 at 9:17 Comment(0)
C
10

One of my first steps in setting up a new Jenkins master is to do what you mention in your question, set "executors" to zero in the master server config.

This prevents anything from ever building on master.

Cloots answered 14/3, 2014 at 16:41 Comment(1)
This is what the little question mark icon next to this field indicates: set it to 0 to avoid building on master.Euphorbiaceous
R
2

While configuring the node, there is option,"leave this machine for tied jobs only" .if "leave this machine for tied jobs only" option is selected Then the slaves will be used by the jobs which are restricted to run on it.

Revolutionize answered 28/1, 2013 at 9:11 Comment(0)
C
1

The better way to do this is to give the master a label and restrict what runs on the master that way each of your builds don't have to specify a label.

Cuxhaven answered 6/2, 2018 at 7:23 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.