I\'m creating a Jenkins pipeline job and I need to run a job on all nodes labelled with a certain label.
Therefore I\'m trying to get a list of node names assigned with
I think that you can do this with:
def nodes = Jenkins.get.getLabel('my-label').getNodes() for (int i = 0; i < nodes.size(); i++) { node(nodes[i].getNodeName()) { // on node } }
I don't know for sure whether this works with cloud nodes.