Using a build variable as the Branch name of a Repository

I have a multi-repository build for which I'm trying to setup plan branches.

Until https://jira.atlassian.com/browse/BAM-11544 is implemented, this is going to be somewhat difficult. However, it has been suggested before to use a build variable to "parameterize" the branch names of all non-default repositories in a build plan.

I have tried using this approach by using ${bamboo.repository.branch.name} in the Branch field of the Repository configuration of all non-default repositories in my build plan. Unfortunately, this is giving me the following error:

(java.lang.RuntimeException : com.atlassian.bamboo.repository.InvalidRepositoryException: Cannot determine head revision of 'ssh://9a161dbd-6f8b-4af6-ba39-8d4a883bffea@127.0.0.1:56487/pscom.git' on branch '${bamboo.repository.branch.name}'. Branch has probably been removed.)

Any idea how I can make this work?

Thanks,

David

2 answers

1 accepted

0 vote

Hi,

I'm afraid you've found a bug. This variable is set too late in the build process to be useful as workaround to BAM-11544.

Please vote on this bug report: https://jira.atlassian.com/browse/BAM-12900

It will work if you define your own plan variable, but sadly, this requires you to override it manually on each branch.

Is there any solution to this problem? I am still getting the same error

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Renan Battaglin
Published May 18, 2017 in Bamboo

FAQ: How to Upgrade Bamboo Server

Bamboo 5.9 will no longer be supported after June 12, 2017. What does this mean? As part of our End of Life policy, Atlassian supports major versions for two years after the first major iteratio...

1,319 views 0 5
Read article

Atlassian User Groups

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

Find a group

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

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you