Skip to content

Instantly share code, notes, and snippets.

@abelboldu
Created July 17, 2015 08:06
Show Gist options
  • Save abelboldu/36810a4f6a05acd8aca3 to your computer and use it in GitHub Desktop.
Save abelboldu/36810a4f6a05acd8aca3 to your computer and use it in GitHub Desktop.
Jenkins scripts n tricks
// CLEAN JOB BUILDS //
// 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()
// STUCK BUILDS AT END: THIS MAY HELP: //
System.setProperty("hudson.util.ProcessTree.disable", "true");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment