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

This widget could not be displayed.

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.

This widget could not be displayed.

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
Atlassian Summit 2018

Meet the community IRL

Atlassian Summit is an excellent opportunity for in-person support, training, and networking.

Learn more
Community showcase
Posted Wednesday in New to Jira

Are you planning to trial, or are currently trialling Jira Software? - We want to talk to you!

Hello! I'm Rayen, a product manager at Atlassian. My team and I are working hard to improve the trial experience for Jira Software Cloud. We are interested in   talking to 20 people planning t...

91 views 1 0
Join discussion

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