Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

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

How can I set different bamboo variable value for automaticaly created branches (using regexp release/.+)

This question is in reference to Atlassian Documentation: Using plan branches

I have plan targeted to develop branch in git. In bamboo I set automatical creating branches for regexp release/.+

Develop branch I need build with maven profile dev but for all of releases branches need build with prod maven profile.

I have one bamboo variable with maven profile, which is set to dev for dev branches, prod for one master branch. When new release branch is created on bamboo, the variable is set to dev as in plan. 

2 answers

1 accepted

1 vote
Answer accepted

This might be not the simplest way but it might just work for you:

  • create script task that compares bamboo built-in variable ${bamboo.planRepositories.branchName} with the regexp
  • the script should create .properties file that defines proper maven target according to the comparison's result
  • you can then inject the properties from the file into the build using Variables Inject Task (bundled with Bamboo)
  • re-configure maven task to use injected variable.

Thank you Marcin.

Your solution is little bit complicated but looks acceptable for me. I will try it.



It is working very well.

I would set a different release plan for production to the dev plans and follow the instructions on to set the naming convention for each.

I would to have only one plan for one component/library.

image2016-1-19 12:4:0.png

Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Bamboo

Bamboo 7.1 is here and is packed with value!

I'm happy to announce that Bamboo 7.1 has been released and it’s overflowing with awesome new features. Top-voted issues First and foremost, a bunch of JAC top voted issues has been delivered - y...

673 views 1 6
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