Created
March 9, 2023 22:26
-
-
Save imoutsatsos/f276fd17a4b79d2831d950c5279496a1 to your computer and use it in GitHub Desktop.
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
/* | |
Execute from the Jenkins script console | |
to delete offline Jenkins nodes | |
taken from answer at https://stackoverflow.com/a/48438012/2612175 | |
*/ | |
for (aSlave in hudson.model.Hudson.instance.slaves) { | |
if (aSlave.getComputer().isOffline()) { | |
aSlave.getComputer().setTemporarilyOffline(true,null); | |
aSlave.getComputer().doDoDelete(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment