Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

How can I stop the ".git" folder being deleted from shared artifact?

Daniel Turner March 2, 2012

I have a build plan setup like the following:

1. Checkout Stage - Spits out a shared artifact containing everything "**/*"

2. Build Stage - Spits out a shared artifact containing everything from 1 plus compiled binaries "**/*"

3. Release Stage - Merges changes to a release branch and does a push

The problem that I am having is that the ".git" folder is not being included in the shared artifacts which then makes stage 3 impossible. It looks like bamboo is using ant to create the artifacts which by default has a list of excludes (.git being one of them). How can I stop this occuring? Is there any way that I can override the default excludes?

2 answers

0 votes
Daniel Turner March 17, 2012

I ended up temporarily renaming it to _git but turns out it's not that simple... The "remote" wasn't what I was expecting but rather a local cache location. It's in the too hard basket for now which is a massive shame. I'm sure that I'm not the first person wanting to do this.

PiotrA
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 17, 2012

Hm... but what exactly are you trying to achieve? To be able to make the Bamboo commit some changes (merge) and push it back to the upstream repo?

Why do you need three stages?

Why do you need to pass the source code as artifact (between stages 1->2->3)? Why not check the code on each stage (this would make the stage 1 not necessary any more)? Otherwise why not combine all the three stages into one Bamboo Job containing multiple Bamboo Tasks?

I'm thinking that your problem you want to solve is not passing the .git folder around the stages, but rather how to merge back changes into the repository - that's why I'm asking these questions, to better understand the situation and give better response.

Daniel Turner March 18, 2012

It was done in stages to allow both Debug and Release builds to happen in parallel in the Build Stage, after having pulled down the source once in the Checkout Stage. Regardless though, the push problem remains. Even if all done sequentially in one stage, I still can't easily push a branch or tag because the remote location is a local cache and not the location specified in the build plan as I had expected.

PiotrA
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 18, 2012

How do you push? By using script task containing something like

git push

?

How about using explicit

git push ssh://git@github.com/org/repo aBranch

?

0 votes
Przemek Bruski
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
March 2, 2012

The easiest way would be to change your artifact to point to a zip file created in a Script Task.

If your Release Stage is not optional, be sure to have a look at the features coming in Bamboo 4, which include automated merges with relase branches.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events