Saltar al contenido

~ / archivo / stackoverflow / 44637234

How to reset build numbers from Linux Jenkins master?

StackOverflow · linux, jenkins · ayudé respuesta aceptada
  1. Shimith pregunta +1 2017-06-19 18:10

    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?

  2. Miguel Ortiz yo respuesta aceptada +1 2017-06-19 20:01

    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:

    [imagen]

    Results:

    [imagen]

← todos los hilos de StackOverflow