jenkinsci/jenkins — pull request #945 by hoodja (2013-09-17 16:16:24+00:00)
Title: Adding CLI for updating next build number

This change will enable a new CLI command from core jenkins "set-next-build-number".
This CLI command makes use of hudson.model.Job#updateNextBuildNumber, which already protects against a new build number less than the current build number.

Exposing this operation as a CLI command will enable automation around creating new jobs that start with a build number larger than one. Today the only way to create a new job that starts at a build number greater than one is to first create the job and then to use the Next Build Number plugin (http://goo.gl/zZLbah).

Because of the special nature of the build number inside the Job model, I suspect the CLI command is the best option. I also considered exposing the build number as part of the mutable configuration but decided against it.

I'm open to other options or suggestions on how to improve this. My ultimate goal is to be able to create a new job that begins with a build number that is greater than 1.

Thanks,
Jim