Posts

Showing posts from March 31, 2018

How to Clean or Reset build numbers in Jenkins job ?

Image
When you were working with some POC or R&D, you may have to do things a number of times until you come to final conclusion. In my recent POC, I was working with Jenkins build jobs for Azure container registry with Azure Managed Container services aka AKS. During this whole activity I have created 70 plus builds and during this process each build was creating one separate tag for docker image on ACR. When this whole POC gets completed, I thought that it will be really good idea to flush/clear out build history and start building from scratch. Situation after completing POC- Below are the step by step instructions for the same- Login to Jenkins server, click on " Manage Jenkins" --> "Script Console". This will open below dialog box. Once you click on "Script Console", then copy and paste below script there and run. Note - Make sure to change the "Job Name" def jobName = "Enter Job Name" def jo...