Commit d9fd0934 by Feanil Patel

Bash in python format string...

parent c2b056b1
...@@ -303,27 +303,24 @@ export HIPCHAT_TOKEN HIPCHAT_ROOM HIPCHAT_MSG_PREFIX HIPCHAT_FROM ...@@ -303,27 +303,24 @@ export HIPCHAT_TOKEN HIPCHAT_ROOM HIPCHAT_MSG_PREFIX HIPCHAT_FROM
export HIPCHAT_MSG_COLOR DATADOG_API_KEY export HIPCHAT_MSG_COLOR DATADOG_API_KEY
# Lifted from ansible-bootstrap.sh #################################### Lifted from ansible-bootstrap.sh
if [[ -z "$ANSIBLE_REPO" ]]; then
set -xe
if [[ -z "${ANSIBLE_REPO}" ]]; then
ANSIBLE_REPO="https://github.com/edx/ansible.git" ANSIBLE_REPO="https://github.com/edx/ansible.git"
fi fi
if [[ -z "${ANSIBLE_VERSION}" ]]; then if [[ -z "$ANSIBLE_VERSION" ]]; then
ANSIBLE_VERSION="master" ANSIBLE_VERSION="master"
fi fi
if [[ -z "${CONFIGURATION_REPO}" ]]; then if [[ -z "$CONFIGURATION_REPO" ]]; then
CONFIGURATION_REPO="https://github.com/edx/configuration.git" CONFIGURATION_REPO="https://github.com/edx/configuration.git"
fi fi
if [[ -z "${CONFIGURATION_VERSION}" ]]; then if [[ -z "$CONFIGURATION_VERSION" ]]; then
CONFIGURATION_VERSION="master" CONFIGURATION_VERSION="master"
fi fi
if [[ -z "${UPGRADE_OS}" ]]; then if [[ -z "$UPGRADE_OS" ]]; then
UPGRADE_OS=false UPGRADE_OS=false
fi fi
...@@ -342,10 +339,10 @@ cat << EOF ...@@ -342,10 +339,10 @@ cat << EOF
Running the abbey with the following arguments: Running the abbey with the following arguments:
ANSIBLE_REPO="${ANSIBLE_REPO}" ANSIBLE_REPO="$ANSIBLE_REPO"
ANSIBLE_VERSION="${ANSIBLE_VERSION}" ANSIBLE_VERSION="$ANSIBLE_VERSION"
CONFIGURATION_REPO="${CONFIGURATION_REPO}" CONFIGURATION_REPO="$CONFIGURATION_REPO"
CONFIGURATION_VERSION="${CONFIGURATION_VERSION}" CONFIGURATION_VERSION="$CONFIGURATION_VERSION"
****************************************************************************** ******************************************************************************
EOF EOF
...@@ -376,13 +373,13 @@ EOF ...@@ -376,13 +373,13 @@ EOF
exit 1; exit 1;
fi fi
EDX_PPA="deb http://ppa.edx.org ${SHORT_DIST} main" EDX_PPA="deb http://ppa.edx.org $SHORT_DIST main"
# Upgrade the OS # Upgrade the OS
apt-get update -y apt-get update -y
apt-key update -y apt-key update -y
if [ "${UPGRADE_OS}" = true ]; then if [ "$UPGRADE_OS" = true ]; then
echo "Upgrading the OS..." echo "Upgrading the OS..."
apt-get upgrade -y apt-get upgrade -y
fi fi
...@@ -394,11 +391,11 @@ apt-get install -y software-properties-common python-software-properties ...@@ -394,11 +391,11 @@ apt-get install -y software-properties-common python-software-properties
add-apt-repository -y ppa:git-core/ppa add-apt-repository -y ppa:git-core/ppa
# For older distributions we need to install a PPA for Python 2.7.10 # For older distributions we need to install a PPA for Python 2.7.10
if [[ "precise" = "${SHORT_DIST}" || "trusty" = "${SHORT_DIST}" ]]; then if [[ "precise" = "$SHORT_DIST" || "trusty" = "$SHORT_DIST" ]]; then
# Add python PPA # Add python PPA
apt-key adv --keyserver "${EDX_PPA_KEY_SERVER}" --recv-keys "${EDX_PPA_KEY_ID}" apt-key adv --keyserver "$EDX_PPA_KEY_SERVER" --recv-keys "$EDX_PPA_KEY_ID"
add-apt-repository -y "${EDX_PPA}" add-apt-repository -y "$EDX_PPA"
fi fi
# Install python 2.7 latest, git and other common requirements # Install python 2.7 latest, git and other common requirements
...@@ -411,18 +408,18 @@ apt-get install -y python2.7 python2.7-dev python-pip python-apt python-yaml pyt ...@@ -411,18 +408,18 @@ apt-get install -y python2.7 python2.7-dev python-pip python-apt python-yaml pyt
# Workaround for a 16.04 bug, need to upgrade to latest and then # Workaround for a 16.04 bug, need to upgrade to latest and then
# potentially downgrade to the preferred version. # potentially downgrade to the preferred version.
# https://github.com/pypa/pip/issues/3862 # https://github.com/pypa/pip/issues/3862
if [[ "xenial" = "${SHORT_DIST}" ]]; then if [[ "xenial" = "$SHORT_DIST" ]]; then
pip install --upgrade pip pip install --upgrade pip
pip install --upgrade pip=="${PIP_VERSION}" pip install --upgrade pip=="$PIP_VERSION"
else else
pip install --upgrade pip=="${PIP_VERSION}" pip install --upgrade pip=="$PIP_VERSION"
fi fi
# pip moves to /usr/local/bin when upgraded # pip moves to /usr/local/bin when upgraded
hash -r #pip may have moved from /usr/bin/ to /usr/local/bin/. This clears bash's path cache. hash -r #pip may have moved from /usr/bin/ to /usr/local/bin/. This clears bash's path cache.
PATH=/usr/local/bin:${PATH} PATH=/usr/local/bin:$PATH
pip install setuptools=="${SETUPTOOLS_VERSION}" pip install setuptools=="$SETUPTOOLS_VERSION"
pip install virtualenv=="${VIRTUAL_ENV_VERSION}" pip install virtualenv=="$VIRTUAL_ENV_VERSION"
##################### END Lifted from ansible-bootstrap.sh ##################### END Lifted from ansible-bootstrap.sh
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment