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 |
| 25 | OSLOMSG_DIR=$DEST/oslo.messaging |
Thierry Carrez | 0915e0c | 2014-01-02 15:05:41 +0100 | [diff] [blame] | 26 | OSLORWRAP_DIR=$DEST/oslo.rootwrap |
Davanum Srinivas | f5aa05c | 2014-02-21 22:03:59 -0500 | [diff] [blame] | 27 | OSLOVMWARE_DIR=$DEST/oslo.vmware |
Doug Hellmann | 6b1cb10 | 2014-02-10 09:59:43 -0800 | [diff] [blame] | 28 | PYCADF_DIR=$DEST/pycadf |
| 29 | STEVEDORE_DIR=$DEST/stevedore |
| 30 | TASKFLOW_DIR=$DEST/taskflow |
Sean Dague | 1b6b531 | 2013-07-31 06:46:34 -0400 | [diff] [blame] | 31 | |
| 32 | # Entry Points |
| 33 | # ------------ |
| 34 | |
| 35 | # install_oslo() - Collect source and prepare |
Ian Wienand | aee18c7 | 2014-02-21 15:35:08 +1100 | [diff] [blame^] | 36 | function install_oslo { |
Sean Dague | db5fadb | 2013-08-09 13:41:33 -0400 | [diff] [blame] | 37 | # TODO(sdague): remove this once we get to Icehouse, this just makes |
| 38 | # for a smoother transition of existing users. |
| 39 | cleanup_oslo |
| 40 | |
Doug Hellmann | 6b1cb10 | 2014-02-10 09:59:43 -0800 | [diff] [blame] | 41 | git_clone $CLIFF_REPO $CLIFF_DIR $CLIFF_BRANCH |
| 42 | setup_develop $CLIFF_DIR |
| 43 | |
Sean Dague | 1b6b531 | 2013-07-31 06:46:34 -0400 | [diff] [blame] | 44 | git_clone $OSLOCFG_REPO $OSLOCFG_DIR $OSLOCFG_BRANCH |
| 45 | setup_develop $OSLOCFG_DIR |
| 46 | |
| 47 | git_clone $OSLOMSG_REPO $OSLOMSG_DIR $OSLOMSG_BRANCH |
| 48 | setup_develop $OSLOMSG_DIR |
Thierry Carrez | 0915e0c | 2014-01-02 15:05:41 +0100 | [diff] [blame] | 49 | |
| 50 | git_clone $OSLORWRAP_REPO $OSLORWRAP_DIR $OSLORWRAP_BRANCH |
| 51 | setup_develop $OSLORWRAP_DIR |
Doug Hellmann | 6b1cb10 | 2014-02-10 09:59:43 -0800 | [diff] [blame] | 52 | |
Davanum Srinivas | f5aa05c | 2014-02-21 22:03:59 -0500 | [diff] [blame] | 53 | git_clone $OSLOVMWARE_REPO $OSLOVMWARE_DIR $OSLOVMWARE_BRANCH |
| 54 | setup_develop $OSLOVMWARE_DIR |
| 55 | |
Doug Hellmann | 6b1cb10 | 2014-02-10 09:59:43 -0800 | [diff] [blame] | 56 | git_clone $PYCADF_REPO $PYCADF_DIR $PYCADF_BRANCH |
| 57 | setup_develop $PYCADF_DIR |
| 58 | |
| 59 | git_clone $STEVEDORE_REPO $STEVEDORE_DIR $STEVEDORE_BRANCH |
| 60 | setup_develop $STEVEDORE_DIR |
| 61 | |
| 62 | git_clone $TASKFLOW_REPO $TASKFLOW_DIR $TASKFLOW_BRANCH |
| 63 | setup_develop $TASKFLOW_DIR |
Sean Dague | 1b6b531 | 2013-07-31 06:46:34 -0400 | [diff] [blame] | 64 | } |
| 65 | |
Sean Dague | db5fadb | 2013-08-09 13:41:33 -0400 | [diff] [blame] | 66 | # cleanup_oslo() - purge possibly old versions of oslo |
Ian Wienand | aee18c7 | 2014-02-21 15:35:08 +1100 | [diff] [blame^] | 67 | function cleanup_oslo { |
Alessio Ababilov | c2a4c92 | 2013-08-16 21:53:22 +0300 | [diff] [blame] | 68 | # this means we've got an old oslo installed, lets get rid of it |
Attila Fazekas | 025fc5e | 2013-08-13 18:55:33 +0200 | [diff] [blame] | 69 | if ! python -c 'import oslo.config' 2>/dev/null; then |
Sean Dague | db5fadb | 2013-08-09 13:41:33 -0400 | [diff] [blame] | 70 | echo "Found old oslo.config... removing to ensure consistency" |
| 71 | local PIP_CMD=$(get_pip_command) |
Alessio Ababilov | c2a4c92 | 2013-08-16 21:53:22 +0300 | [diff] [blame] | 72 | pip_install oslo.config |
| 73 | sudo $PIP_CMD uninstall -y oslo.config |
Sean Dague | db5fadb | 2013-08-09 13:41:33 -0400 | [diff] [blame] | 74 | fi |
| 75 | } |
| 76 | |
Sean Dague | 1b6b531 | 2013-07-31 06:46:34 -0400 | [diff] [blame] | 77 | # Restore xtrace |
| 78 | $XTRACE |
| 79 | |
Adam Spiers | 6a5aa7c | 2013-10-24 11:27:02 +0100 | [diff] [blame] | 80 | # Tell emacs to use shell-script-mode |
| 81 | ## Local variables: |
| 82 | ## mode: shell-script |
| 83 | ## End: |