blob: 718b818ff6be3525ccb657e9c75fdf3c7f713715 [file] [log] [blame]
Sean Dague68322722013-10-21 18:11:40 -04001# lib/stackforge
2#
3# Functions to install stackforge libraries that we depend on so
4# that we can try their git versions during devstack gate.
5#
6# This is appropriate for python libraries that release to pypi and are
7# expected to be used beyond OpenStack like, but are requirements
8# for core services in global-requirements.
9# * wsme
10# * pecan
11#
12# This is not appropriate for stackforge projects which are early stage
13# OpenStack tools
14
15# Dependencies:
16# ``functions`` file
17
18# ``stack.sh`` calls the entry points in this order:
19#
20# install_stackforge
21
22# Save trace setting
23XTRACE=$(set +o | grep xtrace)
24set +o xtrace
25
26
27# Defaults
28# --------
29WSME_DIR=$DEST/wsme
30PECAN_DIR=$DEST/pecan
31
32# Entry Points
33# ------------
34
35# install_stackforge() - Collect source and prepare
36function install_stackforge() {
37 # TODO(sdague): remove this once we get to Icehouse, this just makes
38 # for a smoother transition of existing users.
39 cleanup_stackforge
40
41 git_clone $WSME_REPO $WSME_DIR $WSME_BRANCH
Doug Hellmannaaac4ee2013-11-18 22:12:46 +000042 setup_develop_no_requirements_update $WSME_DIR
Sean Dague68322722013-10-21 18:11:40 -040043
44 git_clone $PECAN_REPO $PECAN_DIR $PECAN_BRANCH
Doug Hellmannaaac4ee2013-11-18 22:12:46 +000045 setup_develop_no_requirements_update $PECAN_DIR
Sean Dague68322722013-10-21 18:11:40 -040046}
47
48# cleanup_stackforge() - purge possibly old versions of stackforge libraries
49function cleanup_stackforge() {
50 # this means we've got an old version installed, lets get rid of it
51 # otherwise python hates itself
52 for lib in wsme pecan; do
53 if ! python -c "import $lib" 2>/dev/null; then
54 echo "Found old $lib... removing to ensure consistency"
55 local PIP_CMD=$(get_pip_command)
56 pip_install $lib
57 sudo $PIP_CMD uninstall -y $lib
58 fi
59 done
60}
61
62# Restore xtrace
63$XTRACE
64
65# Local variables:
66# mode: shell-script
67# End: