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?

1
  • 3
    You could create separate build plans and have each of them trigger on a different set of branches (see the plan branches settings). Jan 29, 2018 at 9:29

2 Answers 2

2

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

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.