3

We using Opscode Chef in our pipeline and we notice that the deployment (see http://docs.opscode.com/resource_deploy.html) creates a complete copy of our sourcecode to /shared/cached-copy

It already has nearly thousand complete versions of it (not just deltas!) in the .git/object folder of it, so filesize growth and growth.

Is there any way to get this cleaned up or even completely prevented? We don't need it at all.

For sure I could write something to delete the directory after each deployment but is there a good way to handle this? Thanks.

Calmon
  • 583
  • 5
  • 18

2 Answers2

1

Cached copy has a purpose, when git pulls changes from the remote the cached copy is used to only pull what is missing, no more. Then this cached copy is clone to a new revision using git, and when git clones repositories on the same disk it creates hard links - so your .git/objects are not duplicated, they are the same files shared across all your "copies". I suggest you leave this directory untouched, it is actually important.

Evgeny
  • 6,533
  • 5
  • 58
  • 64
  • from the link above: repository_cache The name of the sub-directory in which the pristine copy of an application’s source is kept. Default value: cached-copy. It is a full copy of everything. – Calmon Apr 09 '13 at 07:31
1

We are seeing something different. In our case we are using submodules. When a submodule is removed, git pull is not removing the old submodule directory. So we are left with junk. The cached-copy gets copied into releases with this extra code.

Richard Friedman
  • 932
  • 7
  • 11