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

Using a newly created Tag/Branch in checkout tasks at later stages in the plan

I am trying to create a build plan which has a VCS Tagging(or VCS Branching) task in its first stage, and then at later stages uses the newly created tag(or branch) to checkout code from it(repository is SVN). I use a plan variable for the tag/branch name - ${bamboo.repoBranch} - and this variable is also used in the repository URL. I understand that this URL would not be valid until the tagging/branching task is executed, but tasks that try to checkout from that URL are at later stages. From what I understand, there is something like a code change detection phase, during which Bamboo checks all defined repositories for changes(no matter the order they are referenced in the plan or even if they are not used in the plan at all). I think this is the reason my approach doesn't work, is that correct? Here is the exception I get:

com.atlassian.bamboo.repository.InvalidRepositoryException: svn:

at com.atlassian.bamboo.repository.svn.SvnRepository.detectCommitsForUrl(

at com.atlassian.bamboo.repository.svn.SvnRepository.collectChangesSinceLastBuild(

Another alternative to what I am trying to achieve is to have a plan that creates a tag/branch and a child plan of that plan which uses the newly created tag/branch. The problem with this is that plan variables cannot be passed to child plans - I want to use Run Customized to override the value for ${bamboo.repoBranch} and the overriden value to be passed to the child plan. From what I've read the workaround for this is to use a script task which using the Bamboo REST API queues the next plan for execution, but this seems a not very elegant solution.

Any other approaches for what I am trying to achieve will be helpful.


2 answers

1 accepted

0 votes
Answer accepted

You could try switching to that branch/tag using a Script Task.

You can't use Bamboo repsoitories for that because they operate on repository state as it was at the point the build was triggered.

a bit confused by your comment Przemek. You say that it depends on the repo state when the build was triggered but what is the point of the VCS tagging task then? Doesn't tagging infact represent a state of the repository, I mean, that is what tagging is right - marking all the revisions. So, one should be able to use *this* state from the tagging task.

In addition, even if I use the source code checkout task, isn't that the point at which the repo state matters? If the build is triggered and 20 mins later my source code checkout task executes then why would the state of the repo at trigger time matter?

This seems like a limitation. If there is a built in task to create a new tag then it should be available for later tasks. I have parameterized my repo location but I get the exact same error Ivan gets: "repository does not exist". It seems to be validating the repositories before the tasks even start so the tag has not been created yet.

Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Bamboo

Unable to add or edit Bitbucket Cloud repository in Bamboo

On 31 May, a GDPR-related change went live in the Bitbucket Cloud API that resulted in users not being able to create or edit Bitbucket Cloud Linked repositories in Bamboo. This API update removed t...

449 views 2 6
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