Last active
January 17, 2018 10:18
-
-
Save loivis/93ef550af01ad9dc74da24ce9811ee41 to your computer and use it in GitHub Desktop.
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
// delete build history in range and reset build number | |
fullJobName = "full/job/name" | |
start = 1 | |
end = 10 | |
nextBuildNumber = 1 | |
item = Jenkins.instance.getItemByFullName(fullJobName) | |
item.builds.each() { build -> | |
if (build.number >= start && build.number <= end) { | |
println("deleting build: " + build.number) | |
build.delete() | |
} | |
} | |
item.updateNextBuildNumber(nextBuildNumber) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment