Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

How to configure a jenkins node to only accept jobs that specifically requested this node via it's label?

I know how to restrict by Job name on the node configuration page:

enter image description here

But now we have (multibranch pipeline) DSL job scripts that dynamically determine on which node they should run, and request it via node(label: 'NODE-LABEL') { ... }.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

I would like to restrict one of our nodes (a dedicated mac mini responsible for installer signing) to only accept jobs that specifically requested to be run on that node.

>Solution :

In Node Configuration screen there is option "Usage". This dropdown can be used to set nodes to only accept jobs specifically matching the labels of that node.
Node Usage option example in Jenkins UI

The rest of it is to set labels for the node so that there are no accidentally jobs running on it due to matching the labels partially.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading