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

Libor Ondrusek January 18, 2016

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
Marcin Gardias
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
January 25, 2016

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.
Libor Ondrusek January 25, 2016

Thank you Marcin.

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

Libor

Libor Ondrusek February 25, 2016

Thanks.

It is working very well.

0 votes
Phill Fox
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 18, 2016

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.

Libor Ondrusek January 19, 2016

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

Libor Ondrusek January 19, 2016

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

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events