I have come across an option in pipeline that if we don't mention node name and just mention node jenkins will intelligently find which node is free and assign the job to one of the free nodes. sample code below.
parallel (
"stream 1" : {
node {
build 'Job1'
}
},
"stream 2" : {
node {
build 'Job2'
}
}
)
Can I get more info about how does it work and can we provide a list of nodes from which pick one of the free nodes ? Does all the executers in one slave will be used?
Reference doc: https://www.cloudbees.com/blog/parallelism-and-distributed-builds-jenkins
You can let Jenkins select one of your nodes from a subset by assigning the same label to multiple nodes.
This option can be found under "Manage Jenkins -> Manage Nodes -> {Select one of the nodes} -> Configure".
Instead of selecting a node by name, you would use the label like in the following example.
parallel (
"stream 1" : {
node('linux') { // runs on one of the nodes labelled as linux nodes
build 'Job1'
}
},
"stream 2" : {
node('named_node_foo'){ // only runs on node named_foo_node
build 'Job2'
}
}
)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With