Created
July 10, 2019 14:17
-
-
Save clalancette/81dc0f5b8df293c9d7f03f85d48ff891 to your computer and use it in GitHub Desktop.
groovy script to disable lunar jobs
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
import hudson.model.Cause | |
count = 0 | |
for (p in Jenkins.instance.allItems) { | |
if ( | |
( | |
p.name.startsWith("lunar_") || | |
p.name.startsWith("Lsrc_") || | |
p.name.startsWith("Lbin_") || | |
p.name.startsWith("Ldev_") || | |
p.name.startsWith("Ldoc_") || | |
p.name.startsWith("Lpr_") | |
) && | |
p.isBuildable()) | |
{ | |
println(p.name) | |
count += 1 | |
p.disable() | |
} | |
if (count == 100) { | |
break | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment