I'm looking for a way to create a unique semantic version number across multiple plan branches within one plan. E.g. I have a plan to build Git feature branches. I want each feature being built to get a unique version number. I was using the following setup first:
${bamboo.alphaVersion}-alpha${bamboo.buildNumber}
The alphaVersion is set manually (e.g. related to a development sprint). The problem with this, though, is that each plan branch starts its own build numbering and thus we will have overlapping version numbers.
I have tried postfixing the number with
-${bamboo.planRepository.revision}
but this makes the the version number too long, since we're using Octopus Deploy which will only accept version numbers with a maximum length of 20 characters. This could only be a viable solution if I was able to use a substring of this variable's value. But that seems impossible in Bamboo.
I hope someone can help!
Thanks for your feedback, Xabier. I have been diving a bit more into this and ended up in using the following format for now:
${bamboo.alphaVersion}-${bamboo.inject.jiraIssueNumber}${bamboo.buildNumber}
I have indeed used the "Inject Variables from file", with a script to extract the JIRA issue number from the branch name, as described in my related question here.
The other annoying part of this, is that Bamboo generates its own release number following a non-customizable format. But at least the whole chain works now.
I have been fighting with similar issues for a while, my solution so far is to add the branch name to the version:
<PRODUCT_NAME>-X.Y.X_<BRANCH>+buildBBBB
That is
product-1.2.3_FEAT-456_build0876
Not sure this will end up fitting in 20 chars anyway.
Other possible option would be, in the first job of your build, trim the revision number, save it to a file, and inject the variables , defining the scope as the full plan. A bit cumbersome, I know
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.