Skip to content

Instantly share code, notes, and snippets.

@tbreeds
Last active November 8, 2016 02:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tbreeds/285269c8ed35a5378a27ee7af408d670 to your computer and use it in GitHub Desktop.
Save tbreeds/285269c8ed35a5378a27ee7af408d670 to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
function install_os_dep()
{
set -- $( echo $1 | sed -e 's/:/ /')
prefix=$1 # ignored
project=$2
# Now basically turn http://git.openstack.org/cgit/openstack/neutron-lbaas/tree/tools/tox_install.sh into a shell function
}
# Client constraint file contains this client version pin that is in conflict
# with installing the client from source. We should remove the version pin in
# the constraints file before applying it for from-source installation.
BRANCH_NAME=XXX
CLIENT_NAME=XXX
set -e
CONSTRAINTS_FILE=$1
shift
localfile="${VIRTUAL_ENV}/upper-constraints.txt"
if [[ $CONSTRAINTS_FILE != http* ]]; then
CONSTRAINTS_FILE=file://$CONSTRAINTS_FILE
fi
curl $CONSTRAINTS_FILE -k -o $localfile
sed -i~ -e "/^${CLIENT_NAME}===/d" $localfile
deps=""
while [ $# -gt 1 ] ; do
case "$1" in
os:*)
install_os_dep "$1"
;;
*)
deps+="$1"
;;
shift 1
done
pip install -U -c$localfile $deps
exit $?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment