| Sean Dague | 1b6b531 | 2013-07-31 06:46:34 -0400 | [diff] [blame] | 1 | # 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 Spiers | 6a5aa7c | 2013-10-24 11:27:02 +0100 | [diff] [blame] | 9 | # | 
|  | 10 | # - ``functions`` file | 
| Sean Dague | 1b6b531 | 2013-07-31 06:46:34 -0400 | [diff] [blame] | 11 |  | 
|  | 12 | # ``stack.sh`` calls the entry points in this order: | 
|  | 13 | # | 
| Adam Spiers | 6a5aa7c | 2013-10-24 11:27:02 +0100 | [diff] [blame] | 14 | # - install_oslo | 
| Sean Dague | 1b6b531 | 2013-07-31 06:46:34 -0400 | [diff] [blame] | 15 |  | 
|  | 16 | # Save trace setting | 
|  | 17 | XTRACE=$(set +o | grep xtrace) | 
|  | 18 | set +o xtrace | 
|  | 19 |  | 
|  | 20 |  | 
|  | 21 | # Defaults | 
|  | 22 | # -------- | 
| Doug Hellmann | 6b1cb10 | 2014-02-10 09:59:43 -0800 | [diff] [blame] | 23 | CLIFF_DIR=$DEST/cliff | 
| Sean Dague | 1b6b531 | 2013-07-31 06:46:34 -0400 | [diff] [blame] | 24 | OSLOCFG_DIR=$DEST/oslo.config | 
| Victor Sergeyev | da945f3 | 2014-04-28 15:44:29 +0300 | [diff] [blame] | 25 | OSLODB_DIR=$DEST/oslo.db | 
| Doug Hellmann | cd5c813 | 2014-07-02 11:58:35 -0700 | [diff] [blame] | 26 | OSLOI18N_DIR=$DEST/oslo.i18n | 
| Sean Dague | 1b6b531 | 2013-07-31 06:46:34 -0400 | [diff] [blame] | 27 | OSLOMSG_DIR=$DEST/oslo.messaging | 
| Thierry Carrez | 0915e0c | 2014-01-02 15:05:41 +0100 | [diff] [blame] | 28 | OSLORWRAP_DIR=$DEST/oslo.rootwrap | 
| Davanum Srinivas | f5aa05c | 2014-02-21 22:03:59 -0500 | [diff] [blame] | 29 | OSLOVMWARE_DIR=$DEST/oslo.vmware | 
| Doug Hellmann | 6b1cb10 | 2014-02-10 09:59:43 -0800 | [diff] [blame] | 30 | PYCADF_DIR=$DEST/pycadf | 
|  | 31 | STEVEDORE_DIR=$DEST/stevedore | 
|  | 32 | TASKFLOW_DIR=$DEST/taskflow | 
| Sean Dague | 1b6b531 | 2013-07-31 06:46:34 -0400 | [diff] [blame] | 33 |  | 
| Elena Ezhova | 2d45196 | 2014-06-19 12:49:32 +0400 | [diff] [blame] | 34 | # Support entry points installation of console scripts | 
|  | 35 | OSLO_BIN_DIR=$(get_python_exec_prefix) | 
|  | 36 |  | 
| Sean Dague | 1b6b531 | 2013-07-31 06:46:34 -0400 | [diff] [blame] | 37 | # Entry Points | 
|  | 38 | # ------------ | 
|  | 39 |  | 
|  | 40 | # install_oslo() - Collect source and prepare | 
| Ian Wienand | aee18c7 | 2014-02-21 15:35:08 +1100 | [diff] [blame] | 41 | function install_oslo { | 
| Sean Dague | 59d9cec | 2014-04-02 18:43:42 -0400 | [diff] [blame] | 42 | # 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 Hellmann | 6b1cb10 | 2014-02-10 09:59:43 -0800 | [diff] [blame] | 46 | git_clone $CLIFF_REPO $CLIFF_DIR $CLIFF_BRANCH | 
| Sean Dague | 099e5e3 | 2014-03-31 10:35:43 -0400 | [diff] [blame] | 47 | setup_install $CLIFF_DIR | 
| Doug Hellmann | 6b1cb10 | 2014-02-10 09:59:43 -0800 | [diff] [blame] | 48 |  | 
| Doug Hellmann | cd5c813 | 2014-07-02 11:58:35 -0700 | [diff] [blame] | 49 | git_clone $OSLOI18N_REPO $OSLOI18N_DIR $OSLOI18N_BRANCH | 
|  | 50 | setup_install $OSLOI18N_DIR | 
|  | 51 |  | 
| Sean Dague | 1b6b531 | 2013-07-31 06:46:34 -0400 | [diff] [blame] | 52 | git_clone $OSLOCFG_REPO $OSLOCFG_DIR $OSLOCFG_BRANCH | 
| Sean Dague | 099e5e3 | 2014-03-31 10:35:43 -0400 | [diff] [blame] | 53 | setup_install $OSLOCFG_DIR | 
| Sean Dague | 1b6b531 | 2013-07-31 06:46:34 -0400 | [diff] [blame] | 54 |  | 
|  | 55 | git_clone $OSLOMSG_REPO $OSLOMSG_DIR $OSLOMSG_BRANCH | 
| Sean Dague | 099e5e3 | 2014-03-31 10:35:43 -0400 | [diff] [blame] | 56 | setup_install $OSLOMSG_DIR | 
| Thierry Carrez | 0915e0c | 2014-01-02 15:05:41 +0100 | [diff] [blame] | 57 |  | 
|  | 58 | git_clone $OSLORWRAP_REPO $OSLORWRAP_DIR $OSLORWRAP_BRANCH | 
| Sean Dague | 099e5e3 | 2014-03-31 10:35:43 -0400 | [diff] [blame] | 59 | setup_install $OSLORWRAP_DIR | 
| Doug Hellmann | 6b1cb10 | 2014-02-10 09:59:43 -0800 | [diff] [blame] | 60 |  | 
| Doug Hellmann | c729794 | 2014-06-18 11:39:52 -0700 | [diff] [blame] | 61 | git_clone $OSLODB_REPO $OSLODB_DIR $OSLODB_BRANCH | 
|  | 62 | setup_install $OSLODB_DIR | 
|  | 63 |  | 
| Davanum Srinivas | f5aa05c | 2014-02-21 22:03:59 -0500 | [diff] [blame] | 64 | git_clone $OSLOVMWARE_REPO $OSLOVMWARE_DIR $OSLOVMWARE_BRANCH | 
| Sean Dague | 099e5e3 | 2014-03-31 10:35:43 -0400 | [diff] [blame] | 65 | setup_install $OSLOVMWARE_DIR | 
| Davanum Srinivas | f5aa05c | 2014-02-21 22:03:59 -0500 | [diff] [blame] | 66 |  | 
| Doug Hellmann | 6b1cb10 | 2014-02-10 09:59:43 -0800 | [diff] [blame] | 67 | git_clone $PYCADF_REPO $PYCADF_DIR $PYCADF_BRANCH | 
| Sean Dague | 099e5e3 | 2014-03-31 10:35:43 -0400 | [diff] [blame] | 68 | setup_install $PYCADF_DIR | 
| Doug Hellmann | 6b1cb10 | 2014-02-10 09:59:43 -0800 | [diff] [blame] | 69 |  | 
|  | 70 | git_clone $STEVEDORE_REPO $STEVEDORE_DIR $STEVEDORE_BRANCH | 
| Sean Dague | 099e5e3 | 2014-03-31 10:35:43 -0400 | [diff] [blame] | 71 | setup_install $STEVEDORE_DIR | 
| Doug Hellmann | 6b1cb10 | 2014-02-10 09:59:43 -0800 | [diff] [blame] | 72 |  | 
|  | 73 | git_clone $TASKFLOW_REPO $TASKFLOW_DIR $TASKFLOW_BRANCH | 
| Sean Dague | 099e5e3 | 2014-03-31 10:35:43 -0400 | [diff] [blame] | 74 | setup_install $TASKFLOW_DIR | 
| Sean Dague | db5fadb | 2013-08-09 13:41:33 -0400 | [diff] [blame] | 75 | } | 
|  | 76 |  | 
| Sean Dague | 59d9cec | 2014-04-02 18:43:42 -0400 | [diff] [blame] | 77 | # cleanup_oslo() - purge possibly old versions of oslo | 
|  | 78 | function 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 Dague | 1b6b531 | 2013-07-31 06:46:34 -0400 | [diff] [blame] | 88 | # Restore xtrace | 
|  | 89 | $XTRACE | 
|  | 90 |  | 
| Adam Spiers | 6a5aa7c | 2013-10-24 11:27:02 +0100 | [diff] [blame] | 91 | # Tell emacs to use shell-script-mode | 
|  | 92 | ## Local variables: | 
|  | 93 | ## mode: shell-script | 
|  | 94 | ## End: |