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

Sparse git/stash checkout for Bamboo build

Hi all,

We have a single Stash (git) repository for several artifacts that we build. The entire checkout of a single branch is 879 megabytes. However, many of our builds don't need this whole things, and some of them need only a very small part (e.g., a few files).

Is there some way to use the sparse checkout facility of git in order to check out only a single subdirectory using Bamboo (on my Stash repo)? I could then also trigger automatic builds by using the "Include/Exclude Files" option of a repo to monitor only the changed files in there.



1 answer

1 accepted

2 votes
Answer accepted

Hi Douglas,

Currently Bamboo does not support Sparse checkout for git. I've created this feature request on your behalf to have this feature added to the:

Please add your comments to that issue and become a watcher so you can be automatically updated to work on this issue.




Thanks for these details and for creating the issue in the Atlassian system. I wonder if there is a way to pass the repo credentials and other information to a custom check-out script that will then be able to do a sparse checkout instead of the built-in checkout. Any thoughts here?

Hi Douglas, This should definitely be possible, but there will be some caveats. Currently coded checkout tasks utilize a git cache hosted on Bamboo server. The code is checked out by the server and cached, then revisions are checked against that, removing the limitation of needing to create the repo each time. If you are ok with this you can work around it by creating a script that does the checkout and calling that script with the 'script task' in Bamboo build config. You'll either need to hardcode credentials in or call them with a variable in bamboo each time. You'll also need to hardcode the path and you should be able to get revisions from environmental variables. tl;dr: it can be done, but is out of scope of our support team, so if something goes awry we may not be able to help. it will require a bit of work on your end and finagling with the script to get the remote agent to perform the full checkout. Thanks! Turner

Hi Turner, Thanks for the comments. For whatever reason, it seems that the working directory for each build (i.e. each run of the script) is identical and doesn't change for each execution. So that one run sees the junk files from the previous run still there. Is that desired behavior?

I found a setting that cleans the directory after each build. Shame it doesn't clean it BEFORE each build. :)

You could probably run an inline script task at the start of the build plan before checking out the repo to clean the directory if it exists.

It is interesting. The regular workflow with Bamboo seems to keep a copy of the whole Git/Stash repository somewhere and then just use that for a local checkout. It would be much better if I could just tap into that instead of having an entire clone of the Git database here. I am not an expert on Git so I don't know how this all works, but I will have to figure out a better way.

Hi Douglas, This is what I was mentioning with Bamboo keeping a local cached copy. You'll be unable to tap into that without using the preconfigured checkout tasks or some seriously customized code/plugin. That was one of the caveats I mentioned initially. If you want to circumvent that in order to do a sparse checkout you'll forego the usefulness of that feature. Unfortunately, in this case, it seems to be one feature or the other until the improvement has been implemented. Thanks! Turner

Any update on this?

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 ...

190 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