It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Set Release Variables in Bamboo deployment plan

Marcin Cylke Jan 18, 2016

I'd like to pass application version to deployment plan for clearer deploy naming.

Is it possible to set a variable in Bamboo build plan and have it available in Release Variables in my Deployment Plan? I've figured I need to have my variable visible in "Metadata" for the build.

I've tried "Inject bamboo variables" step, but this does not result in variables appearing in "Metadata" tab.

4 answers

0 votes
Phill Fox Jan 18, 2016

Have you reviewed this page for how to name your bamboo releases? https://confluence.atlassian.com/bamboo/naming-versions-for-deployment-releases-361726798.html

Marcin Cylke Jan 18, 2016

Yes I have, before asking the question. 

There is an example of variable planvar with value 'm6'. But there is no info on how to set the value of 'planvar' variable from some build step. I want that variable to be dynamic (calculated by one of the steps), not statically defined in Plan Configuration.

0 votes
Marcin Gardias Atlassian Team Jan 25, 2016

If you set the scope of the variables in Inject Task to 'result' they should work in deployments as well (even if they don't show up on Metadata tab, I can't remember if they do for that matter so don't worry about that. 

That works since Bamboo 5.8 IIRC.

 

Marcin Cylke Jan 25, 2016

I've been down that road before. Today I've tried this again. 

The result visible in logs is:

 

Starting task 'inject variables to build process' of type 'com.atlassian.bamboo.plugins.bamboo-variable-inject-plugin:inject'
Injected variable bamboo.inject.version=1.25.1-SNAPSHOT in RESULT scope

 

But the variable is not injected into the end results. So the proposed solution does not work. At least for me. Perhaps some other debugging could help?

 

My Bamboo version is  Atlassian Bamboo version 5.9.7 build 5920 

0 votes
Andy Kuszyk May 25, 2016

I'm encountering the same issue in Bamboo 5.11.3.

I've set-up the inject task to set values in the "results" scope, and in the build log I can see that the task has set the correct value to the correct variable. However, in the metadata tab (and in downstream deployment project) the value remains unchanged.

Could this be a bug in the inject task?

0 votes
Jon Stalnaker Sep 26, 2018 • edited

Were you ever able to get this resolved?  I'm trying to do the same thing.

**Disregard, I just had my variable named incorrectly.  Result scope worked as expected

Suggest an answer

Log in or Sign up to answer
This widget could not be displayed.
This widget could not be displayed.
Community showcase
Published in Opsgenie

Handling Opsgenie Alerts

Hi everyone, welcome to the kb articles for Opsgenie FAQs. I'm one of the Technical Support Engineers for Opsgenie who will be providing weekly posts on FAQs from customers.   All alerts are ...

63 views 0 3
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you