Bridge between container framework networking and storage models to OpenStack networking and storage abstractions.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

tox_install.sh 1.7KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. #!/usr/bin/env bash
  2. # [limao] This file is refer to tox_install.sh in neutron-lib.
  3. # Library constraint file contains this library version pin that is in conflict
  4. # with installing the library from source. We should replace the version pin in
  5. # the constraints file before applying it for from-source installation.
  6. ZUUL_CLONER=/usr/zuul-env/bin/zuul-cloner
  7. BRANCH_NAME=master
  8. LIB_NAME=kuryr-lib
  9. requirements_installed=$(echo "import openstack_requirements" | python 2>/dev/null ; echo $?)
  10. set -e
  11. CONSTRAINTS_FILE=$1
  12. shift
  13. install_cmd="pip install"
  14. mydir=$(mktemp -dt "$LIB_NAME-tox_install-XXXXXXX")
  15. trap "rm -rf $mydir" EXIT
  16. localfile=$mydir/upper-constraints.txt
  17. if [[ $CONSTRAINTS_FILE != http* ]]; then
  18. CONSTRAINTS_FILE=file://$CONSTRAINTS_FILE
  19. fi
  20. curl $CONSTRAINTS_FILE -k -o $localfile
  21. install_cmd="$install_cmd -c$localfile"
  22. if [ $requirements_installed -eq 0 ]; then
  23. echo "Requirements already installed; using existing package"
  24. elif [ -x "$ZUUL_CLONER" ]; then
  25. pushd $mydir
  26. $ZUUL_CLONER --cache-dir \
  27. /opt/git \
  28. --branch $BRANCH_NAME \
  29. git://git.openstack.org \
  30. openstack/requirements
  31. cd openstack/requirements
  32. $install_cmd -e .
  33. popd
  34. else
  35. if [ -z "$REQUIREMENTS_PIP_LOCATION" ]; then
  36. REQUIREMENTS_PIP_LOCATION="git+https://git.openstack.org/openstack/requirements@$BRANCH_NAME#egg=requirements"
  37. fi
  38. $install_cmd -U -e ${REQUIREMENTS_PIP_LOCATION}
  39. fi
  40. # This is the main purpose of the script: Allow local installation of
  41. # the current repo. It is listed in constraints file and thus any
  42. # install will be constrained and we need to unconstrain it.
  43. edit-constraints $localfile -- $LIB_NAME "-e file://$PWD#egg=$LIB_NAME"
  44. $install_cmd -U $*
  45. exit $?