You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
Next: Root
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
The Atlassian Community can help you and your team get more value out of Atlassian products and practices.
Hello,
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
For it to work a default value must be assigned as a Plan variable, here using master
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...
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:
I hope that helps.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.