How can you include the git folder in a Bamboo Artifact?

We have 3 stages, build, test, deploy in our bamboo plan. The first stage creates an artifact with the pattern **/*

That copies .files and .folders just fine except for .git which I'm guessing comes from http://ant.apache.org/manual/dirtasks.html default excludes

We require the git folder to deploy to heroku via

git push heroku-remote master

Any suggesstions/workarounds? Should I just copy or rsync locally from my ../{project}-BUILD/.git/ folder?

5 answers

1 accepted

This widget could not be displayed.

I successfully copied the .git folder with this pattern

1) Create definition

2) in "Name" what you want

3) in "location" the relative path PLUS .git (so for example I put ".git" because it is in the root of my project)

4) in "copy pattern" put "**"

.. finally I get a new directory with all the git files inside!

The problem I have is that I cannot include the .gitignore files!

Have you made any further progress on this - I am in a similar situation and have managed to copy the .git folder along with my checked out source as you describe but losing the .gitignore is causing problems! A suggestion on another Atlassian Answer is to zip the entire folder and publish the zip as an artifact. This seems a bit over the top for something that seems a relatively basic feature of a CI system.

This widget could not be displayed.

We used Michele's approach for .git folder, but for .gitignore we renamed the file to gitgnore at last step of build stage and in deployment project we renamed it again to .gitignore just after artifact download task.

There should be an option not to ignore hidden files in artifact definition...

This widget could not be displayed.

Just to add to this, I get permission denied when trying to copy the .git folder from the bamboo.buildKey folder on the .pack and .idx files, all other git files copy just fine

This widget could not be displayed.

Just to give a hint, I think it is related to this:

http://ant.apache.org/manual/dirtasks.html#defaultexcludes

This widget could not be displayed.

Any way to override the default excludes in Ant? Documentation says the following, but don't see any corresponding bamboo config:

defaultexcludes="no"

Suggest an answer

Log in or Sign up to answer
Atlassian Summit 2018

Meet the community IRL

Atlassian Summit is an excellent opportunity for in-person support, training, and networking.

Learn more
Community showcase
Posted 7 hours ago in Statuspage

What are your best incident management tips and stories? #HugOps

 👋Community members! Downtime happens. And great incident response takes a village. Teams like Support, Dev, SRE, Ops, IT, and Marketing have to come together to resolve the problem while keep...

25 views 0 2
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you