Browse Source

fix: support updating to compatible layout in ``/srv/charm-store``

Last ``compose`` will require ``/srv/charm-store`` not to use symbolic links
because of bad support in windows support.

Signed-off-by: Valentin Lab <valentin.lab@kalysto.org>
lokavaluto/dev/master
Valentin Lab 5 years ago
parent
commit
960677541f
  1. 15
      precise/host/hooks/install.d/70-0k.sh

15
precise/host/hooks/install.d/70-0k.sh

@ -90,10 +90,19 @@ fi
git clone $GIT_0K_CLONE_OPTIONS "$GIT_0K_BASE/0k/0k-charms.git"
fi
if ! [ -d "/srv/charm-store" ]; then
mkdir -p /srv/charm-store
if [ -d "/srv/charm-store" ]; then
if [ -L "/srv/charm-store" ]; then
info "Already have a valid /srv/charm-store"
elif [ -L "/srv/charm-store/0k-charms" ]; then
mv /srv/charm-store{,.old} &&
mv /srv/charm-store.old/0k-charms /srv/charm-store &&
rmdir /srv/charm-store.old
else
die "Unexpected layout of '/srv/charm-store'. Bailing out."
fi
else
ln -sfn /opt/apps/0k-charms /srv/charm-store
fi
ln -sfn /opt/apps/0k-charms /srv/charm-store/0k-charms
)

Loading…
Cancel
Save