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

Your Points Tracker
Challenges
Leaderboard
  • 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
Recognition
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?
Kudos
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

Checkout branches of a repo dynamically in Bamboo. Edited

 Is it possible to checkout branches in Bamboo using a dynamic value? For instance, if I have a value of 1.0.2, then I want Bamboo to check out and build 1.0.2. If the value is 2.0.2, then I need Bamboo to check out and build 2.0.2. 

1 answer

You want them to be checked out all at once? Or just select certain branches for build? You can use the checkout task to pick any branch you like.

There is also an option to enable branch plans if you just want to build all the branches.

https://confluence.atlassian.com/bamboo/using-plan-branchese-289276872.html

My goal is to automate builds of several repos. 

Thank you for your responses but I'm not sure how I can accomplish my task with those resources you've linked. 

To clarify - can Bamboo check out a given branch from a given repo, and perform the build using a dynamic value for what branch to check out. 

So, if my dynamic value is 1.0.2, then I want the Bamboo plan to checkout and build branch 1.0.2. If it says 2.0.2, then I want to checkout and build branch 2.0.2. If this is possible, where would I set the dynamic value? 

Ah ok, now I understand what you are trying to do. You need to dynamically check out a branch. I am afraid there is no standard task to do it.

How about using the script task to checkout the branches dynamically using the git commands?

I'm looking at the Script task now. You're referring to using the 'Argument' field as the variable correct? I.e., if I want branch 1.0.2, then the 'Argument' field would be '1.0.2' which would then be passed into the script file. That sounds like it should work. 

Would it be possible to change the 'Argument' field on-the-fly? For instance, having an 'Argument' of 1.0.2 and a Powershell script that takes that argument, and retrieve branch 1.0.2 for a specific repo would be fine. However, what if I wanted to check out multiple repos? Is there a Bamboo REST API call that would allow me to dynamically create a new Script Task OR update an existing one?

You can use an external script and modify it on the fly?

Is it possible in bamboo to add 2 checkout tasks. One for the dynamically allocated branch, which is decided on branch build, and one for the default branch.

 

The target is to have e.g. master and branch of master available during the build. But not have all the branches available.

To avoid checking out all the branches, to save time and disk io etc during the build,

Maybe use the checkout task only for the default branch but then use a script task to fetch the dynamic branch using Git commands, when needed?

Suggest an answer

Log in or Sign up to answer
TAGS
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 ...

215 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