Browse code

Merge "add lib/stackforge to let us test wsme / pecan from git"

Jenkins authored on 2013/10/26 00:41:34
Showing 3 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,67 @@
0
+# lib/stackforge
1
+#
2
+# Functions to install stackforge libraries that we depend on so
3
+# that we can try their git versions during devstack gate.
4
+#
5
+# This is appropriate for python libraries that release to pypi and are
6
+# expected to be used beyond OpenStack like, but are requirements
7
+# for core services in global-requirements.
8
+#    * wsme
9
+#    * pecan
10
+#
11
+# This is not appropriate for stackforge projects which are early stage
12
+# OpenStack tools
13
+
14
+# Dependencies:
15
+# ``functions`` file
16
+
17
+# ``stack.sh`` calls the entry points in this order:
18
+#
19
+# install_stackforge
20
+
21
+# Save trace setting
22
+XTRACE=$(set +o | grep xtrace)
23
+set +o xtrace
24
+
25
+
26
+# Defaults
27
+# --------
28
+WSME_DIR=$DEST/wsme
29
+PECAN_DIR=$DEST/pecan
30
+
31
+# Entry Points
32
+# ------------
33
+
34
+# install_stackforge() - Collect source and prepare
35
+function install_stackforge() {
36
+    # TODO(sdague): remove this once we get to Icehouse, this just makes
37
+    # for a smoother transition of existing users.
38
+    cleanup_stackforge
39
+
40
+    git_clone $WSME_REPO $WSME_DIR $WSME_BRANCH
41
+    setup_develop $WSME_DIR
42
+
43
+    git_clone $PECAN_REPO $PECAN_DIR $PECAN_BRANCH
44
+    setup_develop $PECAN_DIR
45
+}
46
+
47
+# cleanup_stackforge() - purge possibly old versions of stackforge libraries
48
+function cleanup_stackforge() {
49
+    # this means we've got an old version installed, lets get rid of it
50
+    # otherwise python hates itself
51
+    for lib in wsme pecan; do
52
+        if ! python -c "import $lib" 2>/dev/null; then
53
+            echo "Found old $lib... removing to ensure consistency"
54
+            local PIP_CMD=$(get_pip_command)
55
+            pip_install $lib
56
+            sudo $PIP_CMD uninstall -y $lib
57
+        fi
58
+    done
59
+}
60
+
61
+# Restore xtrace
62
+$XTRACE
63
+
64
+# Local variables:
65
+# mode: shell-script
66
+# End:
... ...
@@ -299,6 +299,7 @@ source $TOP_DIR/lib/apache
299 299
 source $TOP_DIR/lib/tls
300 300
 source $TOP_DIR/lib/infra
301 301
 source $TOP_DIR/lib/oslo
302
+source $TOP_DIR/lib/stackforge
302 303
 source $TOP_DIR/lib/horizon
303 304
 source $TOP_DIR/lib/keystone
304 305
 source $TOP_DIR/lib/glance
... ...
@@ -629,6 +630,9 @@ install_infra
629 629
 # Install oslo libraries that have graduated
630 630
 install_oslo
631 631
 
632
+# Install stackforge libraries for testing
633
+install_stackforge
634
+
632 635
 # Install clients libraries
633 636
 install_keystoneclient
634 637
 install_glanceclient
... ...
@@ -197,6 +197,16 @@ TROVE_BRANCH=${TROVE_BRANCH:-master}
197 197
 TROVECLIENT_REPO=${TROVECLIENT_REPO:-${GIT_BASE}/openstack/python-troveclient.git}
198 198
 TROVECLIENT_BRANCH=${TROVECLIENT_BRANCH:-master}
199 199
 
200
+# stackforge libraries that are used by OpenStack core services
201
+# wsme
202
+WSME_REPO=${WSME_REPO:-${GIT_BASE}/stackforge/wsme.git}
203
+WSME_BRANCH=${WSME_BRANCH:-master}
204
+
205
+# pecan
206
+PECAN_REPO=${PECAN_REPO:-${GIT_BASE}/stackforge/pecan.git}
207
+PECAN_BRANCH=${PECAN_BRANCH:-master}
208
+
209
+
200 210
 # Nova hypervisor configuration.  We default to libvirt with **kvm** but will
201 211
 # drop back to **qemu** if we are unable to load the kvm module.  ``stack.sh`` can
202 212
 # also install an **LXC**, **OpenVZ** or **XenAPI** based system.  If xenserver-core