Skip to content

Instantly share code, notes, and snippets.

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