6

For example, by branch name you might want to execute different tasks (regress testing in release branches instead of massive integration tests for example).

Is there a mechanism to do that in Bamboo's UI?

Ta Mu
  • 6,792
  • 5
  • 43
  • 83

2 Answers2

3

I don't know if there is some GUI way to do this

I am triggering the same plan in different ways from a REST request by using a variable

To do this

  1. define a variable in the plan configuration variables ie myvariable
  2. in the REST request set bamboo.variable.myvariable to the value required ie "1" or "2"
  3. in the plan stage add a task of script and use the variable as $bamboo_myvariable for instance
if [ "$bamboo_myvariable" == "1" ]; then 
   # stuff to do variation 1
fi
if [ "$bamboo_myvariable" == "2" ]; then
   # suff to do variation 2
fi     

If you want to alter behaviour by branch there are variables such as "bamboo_planRepository_1_branch" which are available by default and could be used ina similar way

Erik Philips
  • 403
  • 1
  • 4
  • 12
Vorsprung
  • 320
  • 3
  • 12
3

Atlassian Labs have now provided this functionality as an add-on: https://marketplace.atlassian.com/apps/1219706/conditional-tasks-for-bamboo?hosting=server&tab=overview

Only available for versions 6.7.1+

Update:

This add-on is only supported up to Bamboo 7.0.6 and conditional tasks are a standard feature in Bamboo 7.1+

https://confluence.atlassian.com/bamboo/bamboo-7-1-release-notes-1013854809.html