Merge lp:~dweaver/orange-box/orange-box-robust-sync-charmstore-tarball into lp:orange-box

Proposed by Darryl Weaver
Status: Merged
Merged at revision: 494
Proposed branch: lp:~dweaver/orange-box/orange-box-robust-sync-charmstore-tarball
Merge into: lp:orange-box
Diff against target: 61 lines (+28/-23)
1 file modified
usr/bin/orange-box-sync-charmstore (+28/-23)
To merge this branch: bzr merge lp:~dweaver/orange-box/orange-box-robust-sync-charmstore-tarball
Reviewer Review Type Date Requested Status
Dustin Kirkland  Pending
Review via email: mp+236793@code.launchpad.net

Description of the change

More robust orange-box-sync-charmstore script.
Now downloads a tarball for the precise and trusty charms.
Then uses bzr to download the landscape server charm.
It only copies into place if the tarball has worked.

Now takes less than 1 minute to sync the charm store.

To post a comment you must log in.
493. By Darryl Weaver

Added missing cinder-ceph charm to local charmstore sync.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'usr/bin/orange-box-sync-charmstore'
--- usr/bin/orange-box-sync-charmstore 2014-10-01 18:44:32 +0000
+++ usr/bin/orange-box-sync-charmstore 2014-10-01 22:44:50 +0000
@@ -27,29 +27,34 @@
2727
28echo Creating Charm Store directories ...28echo Creating Charm Store directories ...
29[ -e /srv/charmstore/ ] || mkdir -p /srv/charmstore/29[ -e /srv/charmstore/ ] || mkdir -p /srv/charmstore/
30DATE=`date +%Y%m%d-%H%M%S`
31mkdir -p /srv/charmstore/snapshot-$DATE
32
33echo Mirroring the Charmstore ...
34cd /srv/charmstore/30cd /srv/charmstore/
35run-one charm getall snapshot-$DATE 2>/dev/null31echo Grabbing the latest charmstore tarball...
36#Branch the Landscape charm - required for Landscape demo to minimise network dependencies32[[ -f "latest.tar.gz" ]] && rm -f latest.tar.gz
37cd snapshot-$DATE33wget -q http://people.canonical.com/~marco/mirror/juju/charmstore/latest.tar.gz
38bzr branch lp:~landscape/landscape-charm/stable landscape >/dev/null 2>&1 || (cd landscape && bzr pull >/dev/null 2>&1)34[[ -f "latest.tar.gz" ]] || exit
39#Branch the cinder-ceph charm - required for openstack35mkdir -p staging
40bzr branch lp:charms/cinder-ceph >/dev/null 2>&1 || (cd cinder-ceph && bzr pull >/dev/null 2>&1)36cd staging
41#Link directories for service aliases37echo Untarring charmstore
42ln -s quantum-gateway neutron-gateway38tar xzf ../latest.tar.gz || exit
43ln -s rabbitmq-server rabbitmq39chown -R root.root *
44#Re-linking to current directories40for series in precise trusty
45rm -f /srv/charmstore/current41do
46ln -s /srv/charmstore/snapshot-$DATE /srv/charmstore/current42 cd $series
47#Re-linking precise43 bzr branch lp:~landscape/landscape-charm/stable landscape
48rm -rf /srv/charmstore/precise44 bzr branch lp:charms/cinder-ceph cinder-ceph
49ln -s /srv/charmstore/current /srv/charmstore/precise45 ln -s quantum-gateway neutron-gateway
50#Re-linking trusty46 ln -s rabbitmq-server rabbitmq
51rm -rf /srv/charmstore/trusty47 cd ..
52ln -s /srv/charmstore/current /srv/charmstore/trusty48done
49cd ..
50echo Removing the old directories...
51rm -rf current
52rm -rf snapshot-*
53rm -rf precise
54rm -rf trusty
55echo Moving new charmstore into place
56mv staging/* ./
57rm -rf staging
58rm -f latest.tar.gz
53echo Done. && echo59echo Done. && echo
54
55echo "Charm store synced to directory /srv/charmstore/"60echo "Charm store synced to directory /srv/charmstore/"

Subscribers

People subscribed via source and target branches