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

Accepted Answer
1 vote

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.

Libor

Thanks.

It is working very well.

I would set a different release plan for production to the dev plans and follow the instructions on https://confluence.atlassian.com/bamboo/naming-versions-for-deployment-releases-361726798.html 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 an hour ago in Jira Ops

Jira Ops Early Access Program Update #1: Announcing our next feature and a new integration

Thanks for signing up for Jira Ops! I’m Matt Ryall, leader for the Jira Ops product team at Atlassian. Since this is a brand new product, we’ll be delivering improvements quickly and sharing updates...

34 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