-->

CI with Jenkins: how to force building happen on s

2019-02-03 11:31发布

问题:

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?

回答1:

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.



回答2:

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.



回答3:

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.



回答4:

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.