Browse code

only clone if the directory doesn't exist already

Jesse Andrews authored on 2011/09/13 09:40:00
Showing 1 changed files
... ...
@@ -48,21 +48,28 @@ apt-get install -y -q `cat $DIR/apts/* | cut -d\# -f1`
48 48
 # install python requirements
49 49
 pip install `cat $DIR/pips/*`
50 50
 
51
+# git clone only if directory doesn't exist already
52
+function git_clone {
53
+    if [ ! -d $2 ]; then
54
+        git clone $1 $2
55
+    fi
56
+}
57
+
51 58
 # compute service
52
-git clone https://github.com/cloudbuilders/nova.git $NOVA_DIR
59
+git_clone https://github.com/cloudbuilders/nova.git $NOVA_DIR
53 60
 # image catalog service
54
-git clone https://github.com/cloudbuilders/glance.git $GLANCE_DIR
61
+git_clone https://github.com/cloudbuilders/glance.git $GLANCE_DIR
55 62
 # unified auth system (manages accounts/tokens)
56
-git clone https://github.com/cloudbuilders/keystone.git $KEYSTONE_DIR
63
+git_clone https://github.com/cloudbuilders/keystone.git $KEYSTONE_DIR
57 64
 # a websockets/html5 or flash powered VNC console for vm instances
58
-git clone https://github.com/cloudbuilders/noVNC.git $NOVNC_DIR
65
+git_clone https://github.com/cloudbuilders/noVNC.git $NOVNC_DIR
59 66
 # django powered web control panel for openstack
60
-git clone https://github.com/cloudbuilders/openstack-dashboard.git $DASH_DIR
67
+git_clone https://github.com/cloudbuilders/openstack-dashboard.git $DASH_DIR
61 68
 # python client library to nova that dashboard (and others) use
62
-git clone https://github.com/cloudbuilders/python-novaclient.git $NOVACLIENT_DIR
69
+git_clone https://github.com/cloudbuilders/python-novaclient.git $NOVACLIENT_DIR
63 70
 # openstackx is a collection of extensions to openstack.compute & nova 
64 71
 # that is *deprecated*.  The code is being moved into python-novaclient & nova.
65
-git clone https://github.com/cloudbuilders/openstackx.git $API_DIR
72
+git_clone https://github.com/cloudbuilders/openstackx.git $API_DIR
66 73
 
67 74
 # setup our checkouts so they are installed into python path
68 75
 # allowing `import nova` or `import glance.client`