Last active
May 27, 2016 15:35
-
-
Save pmdroid/b840f1da3960d5d6584c to your computer and use it in GitHub Desktop.
remove all jenkins builds
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.* | |
// For each project | |
for(item in Hudson.instance.items) { | |
// check that job is not building | |
if(!item.isBuilding()) { | |
System.out.println("Deleting all builds of job "+item.name) | |
for(build in item.getBuilds()){ | |
build.delete() | |
} | |
} | |
else { | |
System.out.println("Skipping job "+item.name+", currently building") | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment