Skip to content

Instantly share code, notes, and snippets.

@rnagarajanmca
Created September 7, 2017 06:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rnagarajanmca/faf199355d94113089289e7d65f99155 to your computer and use it in GitHub Desktop.
Save rnagarajanmca/faf199355d94113089289e7d65f99155 to your computer and use it in GitHub Desktop.
Jenkins setup Guidelines

Clear Jenkins build history

Use the following script to clear the build history from jenkins. Goto Manage Jenkins > Script Console and type the following script

// 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