0

I've seen mentions in Jenkins of editing the "nextBuildNumber" file to change a job's next build.

However the jobs I want to bump the build number for are inside a Github Organisation folder.

I've gone into the config files for the jobs on my Jenkins master instance and changed the value of the "nextBuildNumber" file though it seems to ignore it.

I was wondering if this would be better done via groovy script instead, but I have no idea how I would go about writing something to do that.

My attempt so far is:

import jenkins.model.*
import jenkins.branch.OrganizationFolder

println(Jenkins.instance.items*.fullName.join('\n'))

orgfold = new OrganizationFolder("myorg");

It shows me my two jobs in this Jenkins, the second one being my GithubOrg, and as per the docs at http://javadoc.jenkins.io/plugin/branch-api/jenkins/branch/OrganizationFolder.html

I've tried to consturct an instance of "OrganizationFolder" but I don't think I'm getting it right.

Nexus490
  • 319
  • 1
  • 4
  • 14

1 Answers1

0

As this was only a one time thing, the solution turned out to be pretty simple.

as per:

Changing Jenkins build number

Jenkins.instance.getItemByFullName("<Github Org Name>/<repo name>/<branch name>").updateNextBuildNumber(int)
Nexus490
  • 319
  • 1
  • 4
  • 14