Merge "Use pip install --proxy when $HTTPS_PROXY is set"
This commit is contained in:
commit
ac7bb0306f
@ -21,6 +21,8 @@ set -e -u -x
|
|||||||
## Vars ----------------------------------------------------------------------
|
## Vars ----------------------------------------------------------------------
|
||||||
DEFAULT_PASSWORD=$(tr -dc 'a-zA-Z0-9' < /dev/urandom | head -c 32)
|
DEFAULT_PASSWORD=$(tr -dc 'a-zA-Z0-9' < /dev/urandom | head -c 32)
|
||||||
export BOOTSTRAP_AIO="yes"
|
export BOOTSTRAP_AIO="yes"
|
||||||
|
export HTTP_PROXY=${HTTP_PROXY:-""}
|
||||||
|
export HTTPS_PROXY=${HTTPS_PROXY:-""}
|
||||||
export ADMIN_PASSWORD=${ADMIN_PASSWORD:-$DEFAULT_PASSWORD}
|
export ADMIN_PASSWORD=${ADMIN_PASSWORD:-$DEFAULT_PASSWORD}
|
||||||
export SERVICE_REGION=${SERVICE_REGION:-"RegionOne"}
|
export SERVICE_REGION=${SERVICE_REGION:-"RegionOne"}
|
||||||
export DEPLOY_OPENSTACK=${DEPLOY_OPENSTACK:-"yes"}
|
export DEPLOY_OPENSTACK=${DEPLOY_OPENSTACK:-"yes"}
|
||||||
@ -151,9 +153,17 @@ fi
|
|||||||
# Install pip
|
# Install pip
|
||||||
get_pip
|
get_pip
|
||||||
|
|
||||||
|
# Ensure we use the HTTPS/HTTP proxy with pip if it is specified
|
||||||
|
PIP_OPTS=""
|
||||||
|
if [ -n "$HTTPS_PROXY" ]; then
|
||||||
|
PIP_OPTS="--proxy $HTTPS_PROXY"
|
||||||
|
elif [ -n "$HTTP_PROXY" ]; then
|
||||||
|
PIP_OPTS="--proxy $HTTP_PROXY"
|
||||||
|
fi
|
||||||
|
|
||||||
# Install requirements if there are any
|
# Install requirements if there are any
|
||||||
if [ -f "requirements.txt" ];then
|
if [ -f "requirements.txt" ];then
|
||||||
pip2 install -r requirements.txt || pip install -r requirements.txt
|
pip2 install $PIP_OPTS -r requirements.txt || pip install $PIP_OPTS -r requirements.txt
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Configure all disk space
|
# Configure all disk space
|
||||||
|
@ -20,6 +20,8 @@ set -e -u -x
|
|||||||
|
|
||||||
|
|
||||||
## Vars ----------------------------------------------------------------------
|
## Vars ----------------------------------------------------------------------
|
||||||
|
export HTTP_PROXY=${HTTP_PROXY:-""}
|
||||||
|
export HTTPS_PROXY=${HTTPS_PROXY:-""}
|
||||||
export ANSIBLE_GIT_RELEASE=${ANSIBLE_GIT_RELEASE:-"v1.9.3-1"}
|
export ANSIBLE_GIT_RELEASE=${ANSIBLE_GIT_RELEASE:-"v1.9.3-1"}
|
||||||
export ANSIBLE_GIT_REPO=${ANSIBLE_GIT_REPO:-"https://github.com/ansible/ansible"}
|
export ANSIBLE_GIT_REPO=${ANSIBLE_GIT_REPO:-"https://github.com/ansible/ansible"}
|
||||||
export ANSIBLE_ROLE_FILE=${ANSIBLE_ROLE_FILE:-"ansible-role-requirements.yml"}
|
export ANSIBLE_ROLE_FILE=${ANSIBLE_ROLE_FILE:-"ansible-role-requirements.yml"}
|
||||||
@ -65,13 +67,21 @@ popd
|
|||||||
# Install pip
|
# Install pip
|
||||||
get_pip
|
get_pip
|
||||||
|
|
||||||
|
# Ensure we use the HTTPS/HTTP proxy with pip if it is specified
|
||||||
|
PIP_OPTS=""
|
||||||
|
if [ -n "$HTTPS_PROXY" ]; then
|
||||||
|
PIP_OPTS="--proxy $HTTPS_PROXY"
|
||||||
|
elif [ -n "$HTTP_PROXY" ]; then
|
||||||
|
PIP_OPTS="--proxy $HTTP_PROXY"
|
||||||
|
fi
|
||||||
|
|
||||||
# Install requirements if there are any
|
# Install requirements if there are any
|
||||||
if [ -f "requirements.txt" ];then
|
if [ -f "requirements.txt" ];then
|
||||||
pip2 install -r requirements.txt || pip install -r requirements.txt
|
pip2 install $PIP_OPTS -r requirements.txt || pip install $PIP_OPTS -r requirements.txt
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Install ansible
|
# Install ansible
|
||||||
pip2 install "${ANSIBLE_WORKING_DIR}" || pip install "${ANSIBLE_WORKING_DIR}"
|
pip2 install $PIP_OPTS "${ANSIBLE_WORKING_DIR}" || pip install $PIP_OPTS "${ANSIBLE_WORKING_DIR}"
|
||||||
|
|
||||||
# Update dependent roles
|
# Update dependent roles
|
||||||
if [ -f "${ANSIBLE_ROLE_FILE}" ];then
|
if [ -f "${ANSIBLE_ROLE_FILE}" ];then
|
||||||
|
Loading…
x
Reference in New Issue
Block a user