Browse code

tweaks to comments and cache organization

Anthony Young authored on 2011/09/27 05:12:57
Showing 2 changed files
... ...
@@ -70,7 +70,7 @@ function git_clone {
70 70
 
71 71
 # Warm the base image on first install
72 72
 CACHEDIR=/var/cache/lxc/natty/rootfs-amd64
73
-if [ ! -d $CACHEDIR/opt/nova ]; then
73
+if [ ! -d $CACHEDIR/ ]; then
74 74
     # by deleting the container, we force lxc-create to re-bootstrap (lxc is
75 75
     # lazy and doesn't do anything if a container already exists)
76 76
     lxc-destroy -n $CONTAINER
... ...
@@ -79,18 +79,19 @@ if [ ! -d $CACHEDIR/opt/nova ]; then
79 79
     chroot $CACHEDIR apt-get update
80 80
     chroot $CACHEDIR apt-get install -y --force-yes `cat files/apts/* | cut -d\# -f1 | egrep -v "(rabbitmq|libvirt-bin|mysql-server)"`
81 81
     chroot $CACHEDIR pip install `cat files/pips/*`
82
-
83
-    git_clone $NOVA_REPO $CACHEDIR/opt/nova $NOVA_BRANCH
84
-    git_clone $GLANCE_REPO $CACHEDIR/opt/glance $GLANCE_BRANCH
85
-    git_clone $KEYSTONE_REPO $CACHEDIR/opt/keystone $KEYSTONE_BRANCH
86
-    git_clone $NOVNC_REPO $CACHEDIR/opt/novnc $NOVNC_BRANCH
87
-    git_clone $DASH_REPO $CACHEDIR/opt/dash $DASH_BRANCH $DASH_TAG
88
-    git_clone $NIXON_REPO $CACHEDIR/opt/nixon $NIXON_BRANCH
89
-    git_clone $NOVACLIENT_REPO $CACHEDIR/opt/python-novaclient $NOVACLIENT_BRANCH
90
-    git_clone $OPENSTACKX_REPO $CACHEDIR/opt/openstackx $OPENSTACKX_BRANCH
91
-    git_clone $MUNIN_REPO $CACHEDIR/opt/openstack-munin $MUNIN_BRANCH
92 82
 fi
93 83
 
84
+# Cache openstack code
85
+git_clone $NOVA_REPO $CACHEDIR/opt/nova $NOVA_BRANCH
86
+git_clone $GLANCE_REPO $CACHEDIR/opt/glance $GLANCE_BRANCH
87
+git_clone $KEYSTONE_REPO $CACHEDIR/opt/keystone $KEYSTONE_BRANCH
88
+git_clone $NOVNC_REPO $CACHEDIR/opt/novnc $NOVNC_BRANCH
89
+git_clone $DASH_REPO $CACHEDIR/opt/dash $DASH_BRANCH $DASH_TAG
90
+git_clone $NIXON_REPO $CACHEDIR/opt/nixon $NIXON_BRANCH
91
+git_clone $NOVACLIENT_REPO $CACHEDIR/opt/python-novaclient $NOVACLIENT_BRANCH
92
+git_clone $OPENSTACKX_REPO $CACHEDIR/opt/openstackx $OPENSTACKX_BRANCH
93
+git_clone $MUNIN_REPO $CACHEDIR/opt/openstack-munin $MUNIN_BRANCH
94
+
94 95
 # Destroy the old container
95 96
 lxc-destroy -n $CONTAINER
96 97
 
... ...
@@ -144,6 +144,7 @@ function git_clone {
144 144
         sudo chown `whoami` $2
145 145
         git clone $1 $2
146 146
         cd $2
147
+        # This checkout syntax works for both branches and tags
147 148
         git checkout $3
148 149
     fi
149 150
 }