yalpsid eman
yalpsid eman

Reputation: 3462

Jenkins Build Number stamp

When I build a new version of my project with Jenkins, where does that new build number get placed in my project? Is there a way I can access it in my code?

Upvotes: 0

Views: 310

Answers (1)

VonC
VonC

Reputation: 1329092

It is not placed by default: the build number used by Jenkins is only visible/accesible during your job execution as the environment variable BUILD_NUMBER.

There are plugins helping you infer a more meaningful version number:

But again, they only generate environment variables, they don't "place" that version number into your project.
That is something you have to do, as part of your build steps. See a concrete example in "How to include Jenkins CI build number in Android APK name & app label"

Upvotes: 1

Related Questions