Created
October 7, 2019 03:30
-
-
Save TheDauthi/b291f6e0a8347b83ee76f33ed5e02cce to your computer and use it in GitHub Desktop.
Remove all jenkins builds
This file contains hidden or 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
jobs = Jenkins.instance.getAllItems(AbstractProject.class).collect {it -> Jenkins.instance.getItemByFullName(it.fullName) } | |
for(job in jobs) { | |
job.getBuilds().each { it.delete() } | |
job.nextBuildNumber = 1 | |
job.save() | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment