blob: 5fa4570b74c84fcc07c4b6fa82dbf42c32148788 [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.
Dean Troyerd8864fe2014-02-17 11:00:42 -06009#
10# * wsme
11# * pecan
Sean Dague68322722013-10-21 18:11:40 -040012#
13# This is not appropriate for stackforge projects which are early stage
14# OpenStack tools
15
16# Dependencies:
17# ``functions`` file
18
19# ``stack.sh`` calls the entry points in this order:
20#
21# install_stackforge
22
23# Save trace setting
24XTRACE=$(set +o | grep xtrace)
25set +o xtrace
26
27
28# Defaults
29# --------
30WSME_DIR=$DEST/wsme
31PECAN_DIR=$DEST/pecan
32
33# Entry Points
34# ------------
35
36# install_stackforge() - Collect source and prepare
37function install_stackforge() {
38 # TODO(sdague): remove this once we get to Icehouse, this just makes
39 # for a smoother transition of existing users.
40 cleanup_stackforge
41
42 git_clone $WSME_REPO $WSME_DIR $WSME_BRANCH
Doug Hellmannaaac4ee2013-11-18 22:12:46 +000043 setup_develop_no_requirements_update $WSME_DIR
Sean Dague68322722013-10-21 18:11:40 -040044
45 git_clone $PECAN_REPO $PECAN_DIR $PECAN_BRANCH
Doug Hellmannaaac4ee2013-11-18 22:12:46 +000046 setup_develop_no_requirements_update $PECAN_DIR
Sean Dague68322722013-10-21 18:11:40 -040047}
48
49# cleanup_stackforge() - purge possibly old versions of stackforge libraries
50function cleanup_stackforge() {
51 # this means we've got an old version installed, lets get rid of it
52 # otherwise python hates itself
53 for lib in wsme pecan; do
54 if ! python -c "import $lib" 2>/dev/null; then
55 echo "Found old $lib... removing to ensure consistency"
56 local PIP_CMD=$(get_pip_command)
57 pip_install $lib
58 sudo $PIP_CMD uninstall -y $lib
59 fi
60 done
61}
62
63# Restore xtrace
64$XTRACE
65
66# Local variables:
67# mode: shell-script
68# End: