CI with Jenkins: how to force building happen on s

2019-02-03 11:26发布

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?

4条回答
太酷不给撩
2楼-- · 2019-02-03 11:31

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.

查看更多
Melony?
3楼-- · 2019-02-03 11:37

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.

查看更多
放荡不羁爱自由
4楼-- · 2019-02-03 11:44

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.

查看更多
老娘就宠你
5楼-- · 2019-02-03 11:56

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.

查看更多
登录 后发表回答