Skip to content

Instantly share code, notes, and snippets.

@loivis
Last active January 17, 2018 10:18
Show Gist options
  • Select an option

  • Save loivis/93ef550af01ad9dc74da24ce9811ee41 to your computer and use it in GitHub Desktop.

Select an option

Save loivis/93ef550af01ad9dc74da24ce9811ee41 to your computer and use it in GitHub Desktop.
// delete all build history and reset build number
fullJobName = "full/job/name"
item = Jenkins.instance.getItemByFullName(fullJobName)
item.builds.each() { build ->
build.delete()
}
item.updateNextBuildNumber(1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment