Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Plan branches for feature branches

Deleted user August 11, 2014

Hi,

I have a plan (based on master) which is configured to poll the repository for changes.

Currently i have manualy added an existing branch (develop) to the plan that will use the same configuration of the plan.

Im my use case, the feature branches should execute a slightly different build - hence the tasks are different. Since plan branches can't have different stages / jobs / tasks than the plan, i have decided to create another plan - just for feature branches.

Since feature branches are created on the fly, the plan is again based on the master plan.
I want that the plan will be triggered by polling the repository, but i only want the plan to be triggered for the feature branches - not the master branch.

If i don't create a trigger in the plan, i will need to manually create a trigger for every feature branch that will be detected by Bamboo - which is not feasable.
If i create a trigger for the plan, then any change to the master branch will trigger both the original plan and the feature branches plan which I also don't want.

Is there a way to overcome this?

If not - can a feature be added that you can configure stuff in the plan but tick a checkbox that will say to only apply this on plan branches?

Thanks,

Moti.


2 answers

0 votes
Deleted user August 13, 2014

Hi Rafael,

I am aware of Bamboo variables and also use them in my plans.

I'm not sure however how this helps my scenario - Assuming i want to use tasks rather than scripts - there is no option to define conditions for task execution as far as i know.

Also, since i want to use triggers (which are not able to use variables) that will only be applied on the branches without me having to set them manually for every branch - i don't see how that helps in this scenario also.

Thanks,
Moti.

rsperafico
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
August 13, 2014

Hi Moti,

You are able to use Bamboo variables as a parameter for different Task within Bamboo and as you have mentioned "...the feature branches should execute a slightly different build..." so you could you the branch variable and compare if that branch is the one to run a particular Task.

Imagine that you are running a Maven task, you could use the branch name as a Goal and make your xml to perform what is meant to do based on that branch/Goal.

Kind regards,
Rafael

Deleted user August 13, 2014

Hi Rafael,

I am using bamboo variables in tasks, but how do i achieve this in a single plan:

master / develop / release branches should use "clean deploy" as maven goals while my feature branches should use "clean compile". how do i configure this using bamboo variables (without manually adding plan variables to feature branches)?

Thanks,

Moti.

0 votes
rsperafico
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
August 13, 2014

Hi Moti,

Thank you for your question.

I would suggest you on having a look at Bamboo Variables where you can check which branch the commit was originated from.

# please, create a new Script task in your plan and paste in the following:
echo "bamboo.repository.branch.name: ${bamboo.repository.branch.name}"

Kind regards,
Rafael

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events