Reputation: 87
I have a Linux Jenkins master and one windows slave. I want all the current projects build numbers to be reset, and next time when I start the build it should start from number 1.
How to do that in Linux master? Please provide me the steps to reset build numbers?
Upvotes: 1
Views: 1286
Reputation: 1482
You could use the groovy script console as explained here.
Go into your master Jenkins instance http://your_jenkins_url/script and run this:
item = Jenkins.instance.getItemByFullName("Your Project Name")
//THIS WILL REMOVE ALL BUILD HISTORY
item.builds.each() { build ->
build.delete()
}
item.updateNextBuildNumber(1)
I've tested it in my local setup and it worked:
Results:
Upvotes: 1