Calmon
Calmon

Reputation: 603

Opscode Chef - way to cleanup /shared/cached-copy

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.

Upvotes: 3

Views: 2092

Answers (2)

Richard Friedman
Richard Friedman

Reputation: 942

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.

Upvotes: 1

Evgeny Zislis
Evgeny Zislis

Reputation: 6957

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.

Upvotes: 1

Related Questions