Overwrite global variable in deployment

Hi

Is it possible to overwrite global variables for a build in deployment?

 

Let's say I have a global variable FOOBAR = 1 while build no 1 was done

If I add a variable FOOBAR = 2 in a deployment environment for that project and refer to it in deployment script:

echo ${bamboo_FOOBAR}

 

Will it be 1 or 2?

1 answer

1 accepted

0 votes
Accepted answer

The answer is 2, i.e. it is indeed possible to override global Bamboo variables with plan variables for builds and deployments:

 

Plan variables are similar to global variables, but are defined for specific plans. Plan variables override global variables with the same name. You can also override a plan variable for a build if you trigger the build manually. See Defining plan variables.

While not explicated with a similar precise phrase, the same override mechanism also works for deployment variables:

Variables later in the following list override the previous ones in case of repeating names:

  • global variables
  • release variables as defined below
  • user variables defined at environment level
  • the autogenerated variables in the following table:

[...]

 

Suggest an answer

Log in or Sign up to answer
Community showcase
Published 11 hours ago in Statuspage

194 years of downtime: looking back on incident data from 2018

Statuspage customers logged more than 194 years of collective incidents in 2018. That’s a whopping 87% increase from the  104 years logged in 2017 , and we aren’t even through December yet....

23 views 0 3
Read article

Atlassian User Groups

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

Find a group

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

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you