blob: 421fbce07f502b2bd5205a6c44f8516aed9d4ac8 [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
Victor Sergeyevda945f32014-04-28 15:44:29 +030025OSLODB_DIR=$DEST/oslo.db
Doug Hellmanncd5c8132014-07-02 11:58:35 -070026OSLOI18N_DIR=$DEST/oslo.i18n
Sean Dague1b6b5312013-07-31 06:46:34 -040027OSLOMSG_DIR=$DEST/oslo.messaging
Thierry Carrez0915e0c2014-01-02 15:05:41 +010028OSLORWRAP_DIR=$DEST/oslo.rootwrap
Davanum Srinivasf5aa05c2014-02-21 22:03:59 -050029OSLOVMWARE_DIR=$DEST/oslo.vmware
Doug Hellmann6b1cb102014-02-10 09:59:43 -080030PYCADF_DIR=$DEST/pycadf
31STEVEDORE_DIR=$DEST/stevedore
32TASKFLOW_DIR=$DEST/taskflow
Sean Dague1b6b5312013-07-31 06:46:34 -040033
Elena Ezhova2d451962014-06-19 12:49:32 +040034# Support entry points installation of console scripts
35OSLO_BIN_DIR=$(get_python_exec_prefix)
36
Sean Dague1b6b5312013-07-31 06:46:34 -040037# Entry Points
38# ------------
39
40# install_oslo() - Collect source and prepare
Ian Wienandaee18c72014-02-21 15:35:08 +110041function install_oslo {
Sean Dague59d9cec2014-04-02 18:43:42 -040042 # TODO(sdague): remove this once we get to Icehouse, this just makes
43 # for a smoother transition of existing users.
44 cleanup_oslo
45
Doug Hellmann6b1cb102014-02-10 09:59:43 -080046 git_clone $CLIFF_REPO $CLIFF_DIR $CLIFF_BRANCH
Sean Dague099e5e32014-03-31 10:35:43 -040047 setup_install $CLIFF_DIR
Doug Hellmann6b1cb102014-02-10 09:59:43 -080048
Doug Hellmanncd5c8132014-07-02 11:58:35 -070049 git_clone $OSLOI18N_REPO $OSLOI18N_DIR $OSLOI18N_BRANCH
50 setup_install $OSLOI18N_DIR
51
Sean Dague1b6b5312013-07-31 06:46:34 -040052 git_clone $OSLOCFG_REPO $OSLOCFG_DIR $OSLOCFG_BRANCH
Sean Dague099e5e32014-03-31 10:35:43 -040053 setup_install $OSLOCFG_DIR
Sean Dague1b6b5312013-07-31 06:46:34 -040054
55 git_clone $OSLOMSG_REPO $OSLOMSG_DIR $OSLOMSG_BRANCH
Sean Dague099e5e32014-03-31 10:35:43 -040056 setup_install $OSLOMSG_DIR
Thierry Carrez0915e0c2014-01-02 15:05:41 +010057
58 git_clone $OSLORWRAP_REPO $OSLORWRAP_DIR $OSLORWRAP_BRANCH
Sean Dague099e5e32014-03-31 10:35:43 -040059 setup_install $OSLORWRAP_DIR
Doug Hellmann6b1cb102014-02-10 09:59:43 -080060
Doug Hellmannc7297942014-06-18 11:39:52 -070061 git_clone $OSLODB_REPO $OSLODB_DIR $OSLODB_BRANCH
62 setup_install $OSLODB_DIR
63
Davanum Srinivasf5aa05c2014-02-21 22:03:59 -050064 git_clone $OSLOVMWARE_REPO $OSLOVMWARE_DIR $OSLOVMWARE_BRANCH
Sean Dague099e5e32014-03-31 10:35:43 -040065 setup_install $OSLOVMWARE_DIR
Davanum Srinivasf5aa05c2014-02-21 22:03:59 -050066
Doug Hellmann6b1cb102014-02-10 09:59:43 -080067 git_clone $PYCADF_REPO $PYCADF_DIR $PYCADF_BRANCH
Sean Dague099e5e32014-03-31 10:35:43 -040068 setup_install $PYCADF_DIR
Doug Hellmann6b1cb102014-02-10 09:59:43 -080069
70 git_clone $STEVEDORE_REPO $STEVEDORE_DIR $STEVEDORE_BRANCH
Sean Dague099e5e32014-03-31 10:35:43 -040071 setup_install $STEVEDORE_DIR
Doug Hellmann6b1cb102014-02-10 09:59:43 -080072
73 git_clone $TASKFLOW_REPO $TASKFLOW_DIR $TASKFLOW_BRANCH
Sean Dague099e5e32014-03-31 10:35:43 -040074 setup_install $TASKFLOW_DIR
Sean Daguedb5fadb2013-08-09 13:41:33 -040075}
76
Sean Dague59d9cec2014-04-02 18:43:42 -040077# cleanup_oslo() - purge possibly old versions of oslo
78function cleanup_oslo {
79 # this means we've got an old oslo installed, lets get rid of it
80 if ! python -c 'import oslo.config' 2>/dev/null; then
81 echo "Found old oslo.config... removing to ensure consistency"
82 local PIP_CMD=$(get_pip_command)
83 pip_install oslo.config
84 sudo $PIP_CMD uninstall -y oslo.config
85 fi
86}
87
Sean Dague1b6b5312013-07-31 06:46:34 -040088# Restore xtrace
89$XTRACE
90
Adam Spiers6a5aa7c2013-10-24 11:27:02 +010091# Tell emacs to use shell-script-mode
92## Local variables:
93## mode: shell-script
94## End: