Last active
May 8, 2019 19:36
-
-
Save kylemanna/889b2441eb434a0323e0f313d4a2250e 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
def jobName = "job/staging" | |
def maxNumber = 400 | |
// delete all builds before maxNumber | |
Jenkins.instance.getItemByFullName(jobName).builds.findAll { it.number <= maxNumber }.each { | |
it.delete() | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment