Skip to content

Instantly share code, notes, and snippets.

@clalancette
Last active July 10, 2019 16:01
Show Gist options
  • Save clalancette/deb31bfb1a4b07412d34e2a81ef9eced to your computer and use it in GitHub Desktop.
Save clalancette/deb31bfb1a4b07412d34e2a81ef9eced to your computer and use it in GitHub Desktop.
groovy script to disable indigo jobs
import hudson.model.Cause
count = 0
for (p in Jenkins.instance.allItems) {
if (
(
p.name.startsWith("indigo_") ||
p.name.startsWith("Isrc_") ||
p.name.startsWith("Ibin_") ||
p.name.startsWith("Idev_") ||
p.name.startsWith("Idoc_") ||
p.name.startsWith("Irel_") ||
p.name.startsWith("Ipr_")
) &&
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