Browse code

Merge "add lib/infra"

Jenkins authored on 2013/08/01 05:47:22
Showing 3 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,56 @@
0
+# lib/infra
1
+#
2
+# Functions to install infrastructure projects needed by other projects
3
+# early in the cycle. We need this so we can do things like gate on
4
+# requirements as a global list
5
+
6
+# Dependencies:
7
+# ``functions`` file
8
+
9
+# ``stack.sh`` calls the entry points in this order:
10
+#
11
+# unfubar_setuptools
12
+# install_infra
13
+
14
+# Save trace setting
15
+XTRACE=$(set +o | grep xtrace)
16
+set +o xtrace
17
+
18
+
19
+# Defaults
20
+# --------
21
+PBR_DIR=$DEST/pbr
22
+REQUIREMENTS_DIR=$DEST/requirements
23
+
24
+# Entry Points
25
+# ------------
26
+
27
+# unfubar_setuptools() - Unbreak the giant mess that is the current state of setuptools
28
+function unfubar_setuptools() {
29
+    # this is a giant game of who's on first, but it does consistently work
30
+    # there is hope that upstream python packaging fixes this in the future
31
+    echo_summary "Unbreaking setuptools"
32
+    pip_install -U setuptools
33
+    pip_install -U pip
34
+    uninstall_package python-setuptools
35
+    pip_install -U setuptools
36
+    pip_install -U pip
37
+}
38
+
39
+
40
+# install_infra() - Collect source and prepare
41
+function install_infra() {
42
+    # bring down global requirements
43
+    git_clone $REQUIREMENTS_REPO $REQUIREMENTS_DIR $REQUIREMENTS_BRANCH
44
+
45
+    # Install pbr
46
+    git_clone $PBR_REPO $PBR_DIR $PBR_BRANCH
47
+    setup_develop $PBR_DIR
48
+}
49
+
50
+# Restore xtrace
51
+$XTRACE
52
+
53
+# Local variables:
54
+# mode: shell-script
55
+# End:
... ...
@@ -299,6 +299,7 @@ SERVICE_TIMEOUT=${SERVICE_TIMEOUT:-60}
299 299
 
300 300
 # Source project function libraries
301 301
 source $TOP_DIR/lib/tls
302
+source $TOP_DIR/lib/infra
302 303
 source $TOP_DIR/lib/oslo
303 304
 source $TOP_DIR/lib/horizon
304 305
 source $TOP_DIR/lib/keystone
... ...
@@ -314,8 +315,6 @@ source $TOP_DIR/lib/ldap
314 314
 
315 315
 # Set the destination directories for other OpenStack projects
316 316
 OPENSTACKCLIENT_DIR=$DEST/python-openstackclient
317
-PBR_DIR=$DEST/pbr
318
-
319 317
 
320 318
 # Interactive Configuration
321 319
 # -------------------------
... ...
@@ -588,6 +587,8 @@ if is_service_enabled neutron; then
588 588
     install_neutron_agent_packages
589 589
 fi
590 590
 
591
+# Unbreak the giant mess that is the current state of setuptools
592
+unfubar_setuptools
591 593
 
592 594
 # System-specific preconfigure
593 595
 # ============================
... ...
@@ -658,9 +659,8 @@ fi
658 658
 
659 659
 echo_summary "Installing OpenStack project source"
660 660
 
661
-# Install pbr
662
-git_clone $PBR_REPO $PBR_DIR $PBR_BRANCH
663
-setup_develop $PBR_DIR
661
+# Install required infra support libraries
662
+install_infra
664 663
 
665 664
 # Install oslo libraries that have graduated
666 665
 install_oslo
... ...
@@ -136,6 +136,10 @@ NEUTRON_BRANCH=${NEUTRON_BRANCH:-master}
136 136
 NEUTRONCLIENT_REPO=${NEUTRONCLIENT_REPO:-${GIT_BASE}/openstack/python-neutronclient.git}
137 137
 NEUTRONCLIENT_BRANCH=${NEUTRONCLIENT_BRANCH:-master}
138 138
 
139
+# consolidated openstack requirements
140
+REQUIREMENTS_REPO=${REQUIREMENTS_REPO:-${GIT_BASE}/openstack/requirements.git}
141
+REQUIREMENTS_BRANCH=${REQUIREMENTS_BRANCH:-master}
142
+
139 143
 # storage service
140 144
 SWIFT_REPO=${SWIFT_REPO:-${GIT_BASE}/openstack/swift.git}
141 145
 SWIFT_BRANCH=${SWIFT_BRANCH:-master}