Running a pipeline job on all the nodes with the same label

1,710 views
Skip to first unread message

Michael Pereira

unread,
May 26, 2016, 9:44:04 AM5/26/16
to Jenkins Users
I am forwarding a question from StackOverflow in hope of getting a simpler implementation for this use-case:

Here I have some jobs that are required to run on multiple nodes. If I'm not using Pipeline, I can do with ParameterFactory from the NodeLabel Parameter Plugin and let the job run on all nodes matching a label. With Pipeline however, all I can find is the trigger-job-on-all-nodes example.
With a few modifications it should do the job, but it is still a lot of code. I'm dreaming about things like:
node(label='slave', run_on_all_matching_nodes=true) {
// some block
}
Is this even possible?


Thanks,

Michael

Daniel Beck

unread,
May 31, 2016, 7:10:40 AM5/31/16
to jenkins...@googlegroups.com

> On 26.05.2016, at 15:44, Michael Pereira <pere...@gmail.com> wrote:
>
> With a few modifications it should do the job, but it is still a lot of code. I'm dreaming about things like:
> node(label='slave', run_on_all_matching_nodes=true) {
> // some block
> }
> Is this even possible?

Pipeline global lib should allow you to define a function that does this, for reuse in all your build scripts.

https://github.com/jenkinsci/workflow-cps-global-lib-plugin#pipeline-global-library

Reply all
Reply to author
Forward
0 new messages