Created
July 24, 2017 13:50
-
-
Save jakubjosef/2d849dde575bdd2d0a46b27a3226c46c to your computer and use it in GitHub Desktop.
Disable Jenkins jobs with condition
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 jobs = Jenkins.instance.items.findAll { it.name.startsWith("test") || it.name.startsWith("deploy") } | |
| def counter = 0 | |
| for (job in jobs) { | |
| job.disabled = true | |
| counter++ | |
| } | |
| print("Disabled ${counter} jobs") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment