Skip to content

Instantly share code, notes, and snippets.

@clalancette
Last active July 10, 2019 16:01
Show Gist options
  • Save clalancette/a85db49094f3165083190dce5c851ba7 to your computer and use it in GitHub Desktop.
Save clalancette/a85db49094f3165083190dce5c851ba7 to your computer and use it in GitHub Desktop.
groovy script to delete indigo
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.delete()
}
if (count == 50) {
break
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment