~ / archivo / stackoverflow / 44637234
How to reset build numbers from Linux Jenkins master?
StackOverflow
· linux, jenkins
· ayudé
respuesta aceptada
-
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?
- Software2 2017-06-19 18:13 Possible duplicate of Changing Jenkins build number
-
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: