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
1=== modified file 'usr/bin/orange-box-sync-charmstore'
2--- usr/bin/orange-box-sync-charmstore 2014-10-01 18:44:32 +0000
3+++ usr/bin/orange-box-sync-charmstore 2014-10-01 22:44:50 +0000
4@@ -27,29 +27,34 @@
5
6 echo Creating Charm Store directories ...
7 [ -e /srv/charmstore/ ] || mkdir -p /srv/charmstore/
8-DATE=`date +%Y%m%d-%H%M%S`
9-mkdir -p /srv/charmstore/snapshot-$DATE
10-
11-echo Mirroring the Charmstore ...
12 cd /srv/charmstore/
13-run-one charm getall snapshot-$DATE 2>/dev/null
14-#Branch the Landscape charm - required for Landscape demo to minimise network dependencies
15-cd snapshot-$DATE
16-bzr branch lp:~landscape/landscape-charm/stable landscape >/dev/null 2>&1 || (cd landscape && bzr pull >/dev/null 2>&1)
17-#Branch the cinder-ceph charm - required for openstack
18-bzr branch lp:charms/cinder-ceph >/dev/null 2>&1 || (cd cinder-ceph && bzr pull >/dev/null 2>&1)
19-#Link directories for service aliases
20-ln -s quantum-gateway neutron-gateway
21-ln -s rabbitmq-server rabbitmq
22-#Re-linking to current directories
23-rm -f /srv/charmstore/current
24-ln -s /srv/charmstore/snapshot-$DATE /srv/charmstore/current
25-#Re-linking precise
26-rm -rf /srv/charmstore/precise
27-ln -s /srv/charmstore/current /srv/charmstore/precise
28-#Re-linking trusty
29-rm -rf /srv/charmstore/trusty
30-ln -s /srv/charmstore/current /srv/charmstore/trusty
31+echo Grabbing the latest charmstore tarball...
32+[[ -f "latest.tar.gz" ]] && rm -f latest.tar.gz
33+wget -q http://people.canonical.com/~marco/mirror/juju/charmstore/latest.tar.gz
34+[[ -f "latest.tar.gz" ]] || exit
35+mkdir -p staging
36+cd staging
37+echo Untarring charmstore
38+tar xzf ../latest.tar.gz || exit
39+chown -R root.root *
40+for series in precise trusty
41+do
42+ cd $series
43+ bzr branch lp:~landscape/landscape-charm/stable landscape
44+ bzr branch lp:charms/cinder-ceph cinder-ceph
45+ ln -s quantum-gateway neutron-gateway
46+ ln -s rabbitmq-server rabbitmq
47+ cd ..
48+done
49+cd ..
50+echo Removing the old directories...
51+rm -rf current
52+rm -rf snapshot-*
53+rm -rf precise
54+rm -rf trusty
55+echo Moving new charmstore into place
56+mv staging/* ./
57+rm -rf staging
58+rm -f latest.tar.gz
59 echo Done. && echo
60-
61 echo "Charm store synced to directory /srv/charmstore/"

Subscribers

People subscribed via source and target branches