Sean Dague | 6832272 | 2013-10-21 18:11:40 -0400 | [diff] [blame] | 1 | # lib/stackforge |
| 2 | # |
| 3 | # Functions to install stackforge libraries that we depend on so |
| 4 | # that we can try their git versions during devstack gate. |
| 5 | # |
| 6 | # This is appropriate for python libraries that release to pypi and are |
| 7 | # expected to be used beyond OpenStack like, but are requirements |
| 8 | # for core services in global-requirements. |
| 9 | # * wsme |
| 10 | # * pecan |
| 11 | # |
| 12 | # This is not appropriate for stackforge projects which are early stage |
| 13 | # OpenStack tools |
| 14 | |
| 15 | # Dependencies: |
| 16 | # ``functions`` file |
| 17 | |
| 18 | # ``stack.sh`` calls the entry points in this order: |
| 19 | # |
| 20 | # install_stackforge |
| 21 | |
| 22 | # Save trace setting |
| 23 | XTRACE=$(set +o | grep xtrace) |
| 24 | set +o xtrace |
| 25 | |
| 26 | |
| 27 | # Defaults |
| 28 | # -------- |
| 29 | WSME_DIR=$DEST/wsme |
| 30 | PECAN_DIR=$DEST/pecan |
| 31 | |
| 32 | # Entry Points |
| 33 | # ------------ |
| 34 | |
| 35 | # install_stackforge() - Collect source and prepare |
| 36 | function install_stackforge() { |
| 37 | # TODO(sdague): remove this once we get to Icehouse, this just makes |
| 38 | # for a smoother transition of existing users. |
| 39 | cleanup_stackforge |
| 40 | |
| 41 | git_clone $WSME_REPO $WSME_DIR $WSME_BRANCH |
Doug Hellmann | aaac4ee | 2013-11-18 22:12:46 +0000 | [diff] [blame] | 42 | setup_develop_no_requirements_update $WSME_DIR |
Sean Dague | 6832272 | 2013-10-21 18:11:40 -0400 | [diff] [blame] | 43 | |
| 44 | git_clone $PECAN_REPO $PECAN_DIR $PECAN_BRANCH |
Doug Hellmann | aaac4ee | 2013-11-18 22:12:46 +0000 | [diff] [blame] | 45 | setup_develop_no_requirements_update $PECAN_DIR |
Sean Dague | 6832272 | 2013-10-21 18:11:40 -0400 | [diff] [blame] | 46 | } |
| 47 | |
| 48 | # cleanup_stackforge() - purge possibly old versions of stackforge libraries |
| 49 | function cleanup_stackforge() { |
| 50 | # this means we've got an old version installed, lets get rid of it |
| 51 | # otherwise python hates itself |
| 52 | for lib in wsme pecan; do |
| 53 | if ! python -c "import $lib" 2>/dev/null; then |
| 54 | echo "Found old $lib... removing to ensure consistency" |
| 55 | local PIP_CMD=$(get_pip_command) |
| 56 | pip_install $lib |
| 57 | sudo $PIP_CMD uninstall -y $lib |
| 58 | fi |
| 59 | done |
| 60 | } |
| 61 | |
| 62 | # Restore xtrace |
| 63 | $XTRACE |
| 64 | |
| 65 | # Local variables: |
| 66 | # mode: shell-script |
| 67 | # End: |