Created
November 12, 2020 10:10
-
-
Save olblak/db627bd25e5179e54688e59f67d6fd0c to your computer and use it in GitHub Desktop.
Delete nodes
This file contains 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
#!/usr/bin/env groovy | |
/* Delete online nodes matching a pattern */ | |
Jenkins.instance.computers.each { c -> | |
/* | |
* Delete all offline nodes | |
*/ | |
if (c.isOffline()) { | |
println "Agent ${c.name} offline, deleting" | |
c.doDoDelete() | |
} | |
//if ((c.executors.size() > 0) && (c.name.matches(/Azure.*/)) && (c.isOnline())) { | |
// println "Deleting: ${c.name}" | |
// c.doDoDelete() | |
//} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment