Skip to content

Instantly share code, notes, and snippets.

@clalancette
Created July 10, 2019 14:17
Show Gist options
  • Save clalancette/81dc0f5b8df293c9d7f03f85d48ff891 to your computer and use it in GitHub Desktop.
Save clalancette/81dc0f5b8df293c9d7f03f85d48ff891 to your computer and use it in GitHub Desktop.
groovy script to disable lunar jobs
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