It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Bamboo plan branching with multiple repos

Paul Redmond Sep 05, 2013

I have a plan that uses 2 source repositories. Plan branching picks up the branches on the default repo but when it builds the other repo always checks out the same branch (master). I want the same branch on both repos.

I tried setting branch to ${bamboo.repository.git.branch} in the non-default repositories configutation so it would try to match the default repos branch but that didn't work.

How can I do this?

5 answers

6 votes
Martin Jul 13, 2016

Very disappointing...

2 votes
Marcin Gardias Atlassian Team Sep 12, 2013

At the moment the only option that works is (afaik) to manually define plan variable that points to the branch, and override it on each Plan Branch.

There's an improvement request you can vote on: https://jira.atlassian.com/browse/BAM-11544

tulika gupta Jul 30, 2015

Hi, Can you please explain in detail, how you implemented it?

2 votes
Adam Lins Oct 21, 2013

I just ran smack into this problem myself. I was thinking the only workaround would be to make a clone of the main plan, and configure the repositories for the branch I want. Alternatively, a script block could be used to checkout the right branch on each sub-repo.

I don't fully understand how a plan variable could be used to specify the branch, though.

It is disapointing that the branching feature doesn't work with multiple repositories, particularly where a clean checkout is being done for each build (surely the common case?).

0 votes
Johan Vandeplas Sep 06, 2016

I did something similar.

The first repo (default repo) I did the normal checkout. The second repo I used a script: 

${bamboo.capability.system.git.executable} clone -b ${bamboo.repository.git.branch} ${bamboo_repositoryUrl}

=> where repositoryUrl is a plan variable with the second repository url...

However now I ran into a new problem:

The trigger on the first repo works fine. But on the second repo it doesn't. If I check in on that repo on the default branch, all planBranches are triggered!  If I check in some code to a planBranch no build is triggered.

Jet Aug 09, 2017 • edited

I have similar situation, so what i did was to create another plan that has no jobs in it. Configured the second repository with polling trigger for that new plan that has dependency against the old plan.

So the new plan will be triggered to the old plan whenever there is a changes in your second repository. You can also setup the new plan for the feature branch that will pass to the old plan for the respective branch to do the job too.

0 votes
Ben Stuart Atlassian Team Mar 12, 2018

Hey everyone, just an update on this. BAM-11544and BAM-14127 were released in Bamboo 6.3, There is also another feature request you may be interested in as well: BAM-19675.

Suggest an answer

Log in or Sign up to answer
This widget could not be displayed.
This widget could not be displayed.
Community showcase
Published in Opsgenie

Handling Opsgenie Alerts

Hi everyone, welcome to the kb articles for Opsgenie FAQs. I'm one of the Technical Support Engineers for Opsgenie who will be providing weekly posts on FAQs from customers.   All alerts are ...

64 views 0 3
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you