Comment 10 for bug 1232304

Revision history for this message
Ryan Finnie (fo0bar) wrote : Re: consider tuning git setup for juju-core, and document caveats

Haw Loeung (hloeung) wrote on 2013-12-04:
> This worked for me to reclaim space:

It's a little more complicated than that. Juju appears to work by git pulling from the newly deployed deployer dir (which is a branch of the previously deployed deployer dir) to the charm dir. Therefore, the charm dir must be a git ancestor of the last deployed deployer dir to work. Otherwise upgrade-charm falls on its face.

This procedure seems be the minimum you can clean down to, after an upgrade. It results in two .gits without history:

UNIT=foo-0
git config --global core.bigFileThreshold 10m
git config --global pack.windowMemory 256m
cd /var/lib/juju/agents/unit-${UNIT}
rm -rf charm/.git state/deployer/update-*/.git
(
  cd state/deployer/current/
  git init
  git add .
  git commit -m '[rfinnie] clean slate'
)
rsync -a state/deployer/current/.git/ charm/.git/

Also, if you're looking for stuff to clean in a fat charm environment, keep in mind /var/lib/juju/agents/unit-${UNIT}/state/bundles has previous zips as well.