| 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: | 
|  | 9 | # ``functions`` file | 
|  | 10 |  | 
|  | 11 | # ``stack.sh`` calls the entry points in this order: | 
|  | 12 | # | 
|  | 13 | # install_oslo | 
|  | 14 |  | 
|  | 15 | # Save trace setting | 
|  | 16 | XTRACE=$(set +o | grep xtrace) | 
|  | 17 | set +o xtrace | 
|  | 18 |  | 
|  | 19 |  | 
|  | 20 | # Defaults | 
|  | 21 | # -------- | 
|  | 22 | OSLOCFG_DIR=$DEST/oslo.config | 
|  | 23 | OSLOMSG_DIR=$DEST/oslo.messaging | 
|  | 24 |  | 
|  | 25 | # Entry Points | 
|  | 26 | # ------------ | 
|  | 27 |  | 
|  | 28 | # install_oslo() - Collect source and prepare | 
|  | 29 | function install_oslo() { | 
| Sean Dague | db5fadb | 2013-08-09 13:41:33 -0400 | [diff] [blame] | 30 | # TODO(sdague): remove this once we get to Icehouse, this just makes | 
|  | 31 | # for a smoother transition of existing users. | 
|  | 32 | cleanup_oslo | 
|  | 33 |  | 
| Sean Dague | 1b6b531 | 2013-07-31 06:46:34 -0400 | [diff] [blame] | 34 | git_clone $OSLOCFG_REPO $OSLOCFG_DIR $OSLOCFG_BRANCH | 
|  | 35 | setup_develop $OSLOCFG_DIR | 
|  | 36 |  | 
|  | 37 | git_clone $OSLOMSG_REPO $OSLOMSG_DIR $OSLOMSG_BRANCH | 
|  | 38 | setup_develop $OSLOMSG_DIR | 
|  | 39 | } | 
|  | 40 |  | 
| Sean Dague | db5fadb | 2013-08-09 13:41:33 -0400 | [diff] [blame] | 41 | # cleanup_oslo() - purge possibly old versions of oslo | 
|  | 42 | function cleanup_oslo() { | 
| Alessio Ababilov | c2a4c92 | 2013-08-16 21:53:22 +0300 | [diff] [blame] | 43 | # 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] | 44 | if ! python -c 'import oslo.config' 2>/dev/null; then | 
| Sean Dague | db5fadb | 2013-08-09 13:41:33 -0400 | [diff] [blame] | 45 | echo "Found old oslo.config... removing to ensure consistency" | 
|  | 46 | local PIP_CMD=$(get_pip_command) | 
| Alessio Ababilov | c2a4c92 | 2013-08-16 21:53:22 +0300 | [diff] [blame] | 47 | pip_install oslo.config | 
|  | 48 | sudo $PIP_CMD uninstall -y oslo.config | 
| Sean Dague | db5fadb | 2013-08-09 13:41:33 -0400 | [diff] [blame] | 49 | fi | 
|  | 50 | } | 
|  | 51 |  | 
| Sean Dague | 1b6b531 | 2013-07-31 06:46:34 -0400 | [diff] [blame] | 52 | # Restore xtrace | 
|  | 53 | $XTRACE | 
|  | 54 |  | 
|  | 55 | # Local variables: | 
|  | 56 | # mode: shell-script | 
|  | 57 | # End: |