Here's the scenario:
Our source code is on Github.
We run Bamboo (2.7.3 currently) on a Linux server here at work.
We have several builds that are farmed out to remote agents (for example, to build iPhone software). On the remote agent, Bamboo clones the source from Github, does the build, and then uploads the artifacts to the server. This works exactly as we want/expect.
The problem is, the Bamboo server seems to be checking out the git repository, too, and it does this for every single build plan we have. It's taking up a significant percentage of disk space for these checkouts, and I don't see any way to disable them.
Any ideas?
If you don't need to run any jobs on the main Bamboo server, you can disable the default local agent. See the Bamboo documentation.
At the first run of a plan, Bamboo performs a full clone and stores the data in a local cache directory and complete the build. On subsequent builds, Bamboo does a git fetch from the remote repository to see if there are additional changes and if so, updates the local cache. Similar to the first run, the data for the plan is then checked out from the local cache. Hence, a faster checkout.
If the requirement is about deleting the git repository from the agent and clone it fresh for every build, it is sufficient to just enable "Force Clean Build" option in your Source code checkout task in your plan.
If your requirement is about saving the disk sp ace,it is sufficient to enable "Clean working directory after each build" option in the Plan configuration. This option increases build times especially when you have big Git repositories, but definitely saves disk space.
You might be also interested in voting on this feature request - BAM-13589. Hope that clarifies.
This article explains how stored Git caches speed up builds.