Created
July 17, 2020 07:26
-
-
Save vadikgo/eab7a35a9841f02aa8f5eedbd283c478 to your computer and use it in GitHub Desktop.
List Jenkins nodes with labels
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def hostNames(label) { | |
def nodes = [] | |
Jenkins.instance.computers.each { c -> | |
if (c.node.labelString.contains(label)) { | |
nodes.add(c.node.selfLabel.name) | |
} | |
} | |
return nodes | |
} | |
hostNames('masterLin') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment