Jenkins Tips !!


Tip - 1


To Delete the Builds from Jenkins from N1 to Nn ( For ex- from build4 to build20)

Go to Manage Jenkins --> Script Console and use the below command.

Jenkins.instance.getItemByFullName('JobName').builds.findAll { it.number >  && it.number < 1717 }.each { it.delete()  }


For example:-

Jenkins.instance.getItemByFullName('TestJen').builds.findAll { it.number > 10 && it.number < 38 }.each { it.delete() }

Tip - 2

To modify the next build number in Jenkins.

Jenkins.instance.getItemByFullName("My-Build-Pipeline/feature-improve-build").updateNextBuildNumber(47)


For example:-


Jenkins.instance.getItemByFullName("Organisation/Repository/Branch").updateNextBuildNumber(47)


Tip - 3


To modify the next build number in Jenkins (Another Way of doing)

You can run the following from the Script Console ( $JENKINS_URL/script):

def job = Jenkins.instance.getItemByFullName("folderName/my-pipeline-job")

job.nextBuildNumber = 10

job.save()

Replace folderName/my-pipeline-job with your folder/job name and 10 with the desired next build number.










Comments

  1. As Jenkins World CFP is as yet open, we want to demystify the determination procedure by offering a couple of tips to help increment the possibility of your proposition getting acknowledged. I find a very good website for the Jenkins Build Monitor, If you want you can visit this site.

    ReplyDelete

Post a Comment

Popular posts from this blog

GitHub Administration

Maven Tutorial