Merge lp:~dweaver/orange-box/orange-box-bugfixes-1378248-1378259-1378279-1378281 into lp:orange-box

Proposed by Darryl Weaver
Status: Merged
Merged at revision: 504
Proposed branch: lp:~dweaver/orange-box/orange-box-bugfixes-1378248-1378259-1378279-1378281
Merge into: lp:orange-box
Diff against target: 65 lines (+35/-10)
1 file modified
usr/bin/orange-box-sync-charmstore (+35/-10)
To merge this branch: bzr merge lp:~dweaver/orange-box/orange-box-bugfixes-1378248-1378259-1378279-1378281
Reviewer Review Type Date Requested Status
Dustin Kirkland  Pending
Review via email: mp+237406@code.launchpad.net

Description of the change

Fixes for orange-box-sync-charmstore to improve handling and add additional error checking.

To post a comment you must log in.

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-02 21:05:23 +0000
+++ usr/bin/orange-box-sync-charmstore 2014-10-07 11:49:23 +0000
@@ -23,26 +23,51 @@
23set -x23set -x
24set -e24set -e
2525
26if ! mkdir -p $BASEDIR; then26if [ "$(id -u)" != "0" ]; then
27 echo "Execute as root or with 'sudo $0'"27 echo "Must be run with sudo or by root"
28 exit 128 exit 1
29fi29fi
3030
31bzr launchpad-login && rm -rf ~/.bazaar && bzr launchpad-login && echo "Unkown error with bzr launchpad-login" && exit 1
32
33mkdir -p $BASEDIR
31cd $BASEDIR34cd $BASEDIR
32echo Grabbing the latest charmstore tarball...35echo Grabbing the latest charmstore tarball...
33rm -f "$BASEDIR/latest.tar.gz"36rm -f "$BASEDIR/latest.tar.gz"
34wget -q http://people.canonical.com/~marco/mirror/juju/charmstore/latest.tar.gz -O "$BASEDIR/latest.tar.gz"37wget -q http://people.canonical.com/~marco/mirror/juju/charmstore/latest.tar.gz -O "$BASEDIR/latest.tar.gz" || exit 1
35mkdir -p "$BASEDIR/staging"38mkdir -p "$BASEDIR/staging"
36echo Untarring charmstore39echo Untarring charmstore
37tar xzf "$BASEDIR/latest.tar.gz" -C "$BASEDIR/staging"40tar xzf "$BASEDIR/latest.tar.gz" -C "$BASEDIR/staging"
38for series in precise trusty; do41for series in precise trusty; do
39 d="$BASEDIR/$series"42 d="$BASEDIR/staging/$series"
40 mkdir -p "$d"43 if [ ! -e $d/landscape ];then
41 bzr branch lp:landscape-charm "$d/landscape"44 bzr branch lp:landscape-charm "$d/landscape"
42 bzr branch lp:charms/cinder-ceph "$d/cinder-ceph"45 fi
43 ln -s quantum-gateway "$d/neutron-gateway"46 if [ ! -e $d/cinder-ceph ]; then
44 ln -s rabbitmq-server "$d/rabbitmq"47 bzr branch lp:charms/cinder-ceph "$d/cinder-ceph"
48 fi
49 if [ ! -e $d/neutron-gateway ]; then
50 ln -s quantum-gateway "$d/neutron-gateway"
51 fi
52 if [ ! -e $d/rabbitmq ]; then
53 ln -s rabbitmq-server "$d/rabbitmq"
54 fi
55 #Check for some charms that are pre-requisites for demos to run.
56 if [ ! -e $d/juju-gui ]; then
57 echo "Cannot find juju-gui in charm store update, it is required, exiting."
58 exit 1
59 fi
60 if [ ! -e $d/mysql ]; then
61 echo "Cannot find mysql in charm store update, it is required, exiting."
62 exit 1
63 fi
64 if [ ! -e $d/rabbitmq-server ]; then
65 echo "Cannot find rabbitmq-server in charm store update, it is required, exiting."
66 exit 1
67 fi
45done68done
69
70chown -R root.root $BASEDIR
46echo "Removing the old directories..."71echo "Removing the old directories..."
47rm -rf "$BASEDIR/current" "$BASEDIR/snapshot-"* "$BASEDIR/precise" "$BASEDIR/trusty"72rm -rf "$BASEDIR/current" "$BASEDIR/snapshot-"* "$BASEDIR/precise" "$BASEDIR/trusty"
48echo "Moving new charmstore into place"73echo "Moving new charmstore into place"

Subscribers

People subscribed via source and target branches