You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
Next: Root
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
Hello,
when executing deployment project environment(deployment), my task is using two variables:
${bamboo.deploy.release.previous}
${bamboo.deploy.release}
When I am trying to deploy for the first time in this environment variable ${bamboo.deploy.release.previous} is not yet initialized because there is no previous version in this environment.
How do I catch this in Bamboo specs so I can substitute it with another value and get my tasks executed?
The error that I am getting is:
-PdiffFrom=${bamboo.deploy.release.previous}: bad substitution
Thanks in advance,
Gregor
Actually I found the solution myself when rereading the documentation https://confluence.atlassian.com/bamboo0610/variables-for-deployment-environments-980469289.html
"...Variables later in the following list override the previous ones in case of repeating names..."
What I did was that I created a variable with the same name and set it to an empty string and added it to the environment:
Variable from = new Variable("bamboo.deploy.release.previous", "");
If bamboo does not create this variable because there are no deployments made to the environment, it is an empty string. If bamboo creates the variable it gets overridden by the release string that is currently deployed on the said environment.
Sorry if this question was a bit premature, but maybe somebody will find use in it.
Best regards,
Gregor
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.