blob: b089842ae434a19fc7129393f4663c0a440808ef [file] [log] [blame]
Sean Dague1b6b5312013-07-31 06:46:34 -04001# lib/oslo
2#
3# Functions to install oslo libraries from git
4#
5# We need this to handle the fact that projects would like to use
6# pre-released versions of oslo libraries.
7
8# Dependencies:
Adam Spiers6a5aa7c2013-10-24 11:27:02 +01009#
10# - ``functions`` file
Sean Dague1b6b5312013-07-31 06:46:34 -040011
12# ``stack.sh`` calls the entry points in this order:
13#
Adam Spiers6a5aa7c2013-10-24 11:27:02 +010014# - install_oslo
Sean Dague1b6b5312013-07-31 06:46:34 -040015
16# Save trace setting
17XTRACE=$(set +o | grep xtrace)
18set +o xtrace
19
20
21# Defaults
22# --------
Doug Hellmann6b1cb102014-02-10 09:59:43 -080023CLIFF_DIR=$DEST/cliff
Sean Dague1b6b5312013-07-31 06:46:34 -040024OSLOCFG_DIR=$DEST/oslo.config
25OSLOMSG_DIR=$DEST/oslo.messaging
Thierry Carrez0915e0c2014-01-02 15:05:41 +010026OSLORWRAP_DIR=$DEST/oslo.rootwrap
Doug Hellmann6b1cb102014-02-10 09:59:43 -080027PYCADF_DIR=$DEST/pycadf
28STEVEDORE_DIR=$DEST/stevedore
29TASKFLOW_DIR=$DEST/taskflow
Sean Dague1b6b5312013-07-31 06:46:34 -040030
31# Entry Points
32# ------------
33
34# install_oslo() - Collect source and prepare
35function install_oslo() {
Sean Daguedb5fadb2013-08-09 13:41:33 -040036 # TODO(sdague): remove this once we get to Icehouse, this just makes
37 # for a smoother transition of existing users.
38 cleanup_oslo
39
Doug Hellmann6b1cb102014-02-10 09:59:43 -080040 git_clone $CLIFF_REPO $CLIFF_DIR $CLIFF_BRANCH
41 setup_develop $CLIFF_DIR
42
Sean Dague1b6b5312013-07-31 06:46:34 -040043 git_clone $OSLOCFG_REPO $OSLOCFG_DIR $OSLOCFG_BRANCH
44 setup_develop $OSLOCFG_DIR
45
46 git_clone $OSLOMSG_REPO $OSLOMSG_DIR $OSLOMSG_BRANCH
47 setup_develop $OSLOMSG_DIR
Thierry Carrez0915e0c2014-01-02 15:05:41 +010048
49 git_clone $OSLORWRAP_REPO $OSLORWRAP_DIR $OSLORWRAP_BRANCH
50 setup_develop $OSLORWRAP_DIR
Doug Hellmann6b1cb102014-02-10 09:59:43 -080051
52 git_clone $PYCADF_REPO $PYCADF_DIR $PYCADF_BRANCH
53 setup_develop $PYCADF_DIR
54
55 git_clone $STEVEDORE_REPO $STEVEDORE_DIR $STEVEDORE_BRANCH
56 setup_develop $STEVEDORE_DIR
57
58 git_clone $TASKFLOW_REPO $TASKFLOW_DIR $TASKFLOW_BRANCH
59 setup_develop $TASKFLOW_DIR
Sean Dague1b6b5312013-07-31 06:46:34 -040060}
61
Sean Daguedb5fadb2013-08-09 13:41:33 -040062# cleanup_oslo() - purge possibly old versions of oslo
63function cleanup_oslo() {
Alessio Ababilovc2a4c922013-08-16 21:53:22 +030064 # this means we've got an old oslo installed, lets get rid of it
Attila Fazekas025fc5e2013-08-13 18:55:33 +020065 if ! python -c 'import oslo.config' 2>/dev/null; then
Sean Daguedb5fadb2013-08-09 13:41:33 -040066 echo "Found old oslo.config... removing to ensure consistency"
67 local PIP_CMD=$(get_pip_command)
Alessio Ababilovc2a4c922013-08-16 21:53:22 +030068 pip_install oslo.config
69 sudo $PIP_CMD uninstall -y oslo.config
Sean Daguedb5fadb2013-08-09 13:41:33 -040070 fi
71}
72
Sean Dague1b6b5312013-07-31 06:46:34 -040073# Restore xtrace
74$XTRACE
75
Adam Spiers6a5aa7c2013-10-24 11:27:02 +010076# Tell emacs to use shell-script-mode
77## Local variables:
78## mode: shell-script
79## End: