I am trying to set the next build number for our release branch programmatically, but I ran into a problem.
Below are two ways I tried this:
def job = Jenkins.instance.getItem("master")
job.nextBuildNumber = env.BUILD_NUMBER + 1
job.saveNextBuildNumber()
I also tried using the command CLI:
java -jar ${env.HOME} jenkins-cli.jar -s XX-JENKINS-SERVER" set-next-build-number 'Pipeline/master' 44
But no luck.
Please tell me how to configure the next assembly number for multi-unit piping.
source
share