How to get a list of all Jenkins nodes assigned with label including master node?

后端 未结 6 1323
囚心锁ツ
囚心锁ツ 2021-02-18 21:25

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

6条回答
  •  粉色の甜心
    2021-02-18 22:22

    Try using for (aSlave in hudson.model.Hudson.instance.slaves) {} and aSlave.getLabelString()); to get all the labels for all of your nodes. You can construct a list of nodes per label this way.

提交回复
热议问题