Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Deleted user
0 / 0 points
badges earned

Your Points Tracker
  • Global
  • Feed

Badge for your thoughts?

You're enrolled in our new beta rewards program. Join our group to get the inside scoop and share your feedback.

Join group
Give the gift of kudos
You have 0 kudos available to give
Who do you want to recognize?
Why do you want to recognize them?
Great job appreciating your peers!
Check back soon to give more kudos.

Past Kudos Given
No kudos given
You haven't given any kudos yet. Share the love above and you'll see it here.

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

Dynamic git source code checkout


I'm trying to achieve a git checkout of a specific tag/commit controlled by the execution of the build process.

In the plan configuration, I defined the repository to use a variable as a branch

Screenshot from 2019-06-06 15-10-19.png

For it to work a default value must be assigned as a Plan variable, here using masterScreenshot from 2019-06-06 15-09-55.png

Then in the build execution this variable value is overridden with a specific commit hash.


My issue is that when the corresponding Source code checkout task is executed, it is first checking out the repository before substituting the variable.

simple 06-Jun-2019 14:41:24 Starting task 'Checkout' of type 'com.atlassian.bamboo.plugins.vcs:task.vcs.checkout' simple 06-Jun-2019 14:41:24 Checking out into /ec/local/citnet/bamboo-agent-home/xml-data/build-dir/DISSCHAIN-DISSCHAINSOA25-REE/disschain-impl/extraction simple 06-Jun-2019 14:41:24 Updating source code to revision: 94b8954182c9d96cb7f511b0a62caf226eb76b7a command 06-Jun-2019 14:41:24 Substituting variable: ${bamboo.sources.release.tag} with 99b82efeed26c459d79d29cfd7d38226b88c55e8

So I end up with the wrong content.

I suppose the issue is because the repository is pooled for Change Detection by the Bamboo build upfront, but that is not what I need. In my case this is a copy of the main repository

I hope there is another configuration to achieve such dynamic checkout, but I need help finding it please...



1 answer

0 votes

Hello @Philippe Weber

I think I understand what you need, but I also know that you cannot achieve it using the strategy you planned.

Bamboo will now allow you to change server instance variables. The best you can do is to change them in the terminal, but that will not serve to your purpose. Tasks run from JAVA runtime which evaluates the variables before running the command on terminal.

Reference on variables not being overwritten:

I see two options for you to move forward:

  1. Run a customized build
    You will be able to give a specific value to any plan variables if you run a customized build. More details at: Running a plan build manually.
  2. Check out your code from a script task
    You won't have the facilities of a task or shared credentials for this, but you should be able to check out any repository as you can from your terminal.

I hope that helps.

Suggest an answer

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

Bamboo 101 Video

G’day Community! As we gear up to introduce Bamboo Data Center to the world, we wanted to make sure that we shared a bit more about Bamboo, the product. Our team has put together an overview video ...

227 views 4 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