5

I have a few Jenkins slaves, some of them are labeled by "X", and others with "Y" label. I'd like to choose group of slaves, based on their label, when I starting this job from its upstream job. I.e. I want to pass a value for a label (for NodeLabelParameter plugin) as a parameter.

I already played with a NodeLabelParameter and Parameterized Trigger plugins, reviewed http://www.shaunabram.com/dynamically-set-jenkins-node/ and similar articles, but still wasn't able to implement a flow I need.

2

Solved by using NodeLabelParameter and Parameterized Trigger plugins. For some reason I missed that I need to use BuildParameterFactory in order to run on all slaves with chosen label.

-2

It is good to use Label nodes when you want a node to be reserved for certain kinds of jobs, while preventing all other jobs from using that machine.

Lets say you want the slave run jobs which are labelled as slave and the master node to only run jobs which are labelled as master.

Manage Jenkins -> mange nodes -> configure -> Usage -> "only build job with label expression matching this node" , then in the label input box put slave and save.

Next configure the master machine under nodes, Usage -> "only build job with label expression matching this node" , then in the label input box put master and save.

Next label the job -> restrict when this project can run - in the label input box put master so the job can only run on master node and click save.

and so on... hope you understand the concept.

  • Thank you, but it's not that I asked. – Vitaly Aug 16 '17 at 7:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.