It seems that ${bamboo.repository.revision.number} doesn't work like it does in a normal Plan. Is there something else I can use?
Hello Michael,
Thank you for your question.
Please, add a Script task to your Deployment plan with the following:
# if Windows, uncomment the following line by removing the hash (#) character #env # if Linux, uncomment the following line by removing the hash (#) character #set
The above will display all the environment variables that are available to your deployment.
Please, make sure you have a task to Source Code Checkout from your Subversion repository in your Deployment plan.
If you find this answer useful, I would kindly ask you to accept it so the same will be visible to others who might be facing the same issue you have inquired.
Thank you for your understanding.
—
Kind regards,
Rafael P. Sperafico
Atlassian Support
So if I add a "set" command to my Windows script, I see the variable bamboo_planRepository_revision. Translating this into ${bamboo.planRepository.revision} I can use it for variable substitution in the deployment. (I have no idea why "number" gets taken off the variable name for deployment plans. I had already tried both repository and planRepository, as I believe, at least in normal Plans, they are synonymous.)
However, I cannot use this variable for Release Versioning. It does not get substituted.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
${bamboo.repository.revision.number} is an old implementation, designed before we introduced Multiple Repositories and doesn't really work well with the feature. As in: we cannot fix it in a way that wouldn't possibly brake some users' builds. That's why it is considered deprecated and new format has been introduced. Which version are you on? I'm pretty sure repository variables can be used in release names. For that matter, plan we use to deploy our internal Bamboo server does exactly that...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
We are on Bamboo 5.6.2. For our release versioning in our deployment plan we have ${bamboo.productMajorRev}.${bamboo.productMinorRev}.${bamboo.buildNumber}.${bamboo.planRepository.revision} (The first two are global variables) If I go to create a release, in "This version" I get 1.0.1418.${bamboo.planRepository.revision}. SVN is our underlying repository, if that matters.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
There was significant changes to variables engine in Bamboo 5.7, so perhaps that's one of the issues that was fixed back then, because I'm quite certain it works in current version. I will verify and get back to you.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Marcin, a little claification I found today. If I create a new release via deployment, the ${bamboo.planRepository.revision} works. It is only if I go to "Create Release" (not via deployment) directly that it doesn't substitute the information.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi, I just tested it in Bamboo 5.6.2 and if you click Create Release then variable is not substituted in the ui, but if I continue, the release name is created correctly.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The same test in 5.8.1 and it works no problem.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.