Login to jenkins with admin user. Click 'manage jenkins' then 'script console' and enter the above .txt file
Created
February 23, 2018 17:43
-
-
Save ConnerAiken/6dcf032c4e60fbc7f50a6c699ab5da87 to your computer and use it in GitHub Desktop.
Jenkins - Clear build history
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
// change this variable to match the name of the job whose builds you want to delete | |
def jobName = "Your Job Name" | |
def job = Jenkins.instance.getItem(jobName) | |
job.getBuilds().each { it.delete() } | |
// uncomment these lines to reset the build number to 1: | |
//job.nextBuildNumber = 1 | |
//job.save() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment