diff options
author | Jose Lausuch <jose.lausuch@ericsson.com> | 2016-04-13 07:59:30 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@172.30.200.206> | 2016-04-13 07:59:30 +0000 |
commit | 528ede4824d5966973f84fb80d548bba2dade4f8 (patch) | |
tree | 3235ec77e7c13c84968a3a1420780e345ebb5942 /docker | |
parent | 672af86748a7721fbd08dd26f7ce257364662c02 (diff) | |
parent | 7c5eb08436bb85f499eb0e84be759f11deb1f404 (diff) |
Merge "add bash script to config pip and easy_install"
Diffstat (limited to 'docker')
-rw-r--r-- | docker/config_install_env.sh | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/docker/config_install_env.sh b/docker/config_install_env.sh new file mode 100644 index 00000000..ed67994f --- /dev/null +++ b/docker/config_install_env.sh @@ -0,0 +1,26 @@ +#!/bin/bash + +set -e + +PIP_PATH=~/.pip +PIP_CONF=$PIP_PATH/pip.conf +EASY_INSTALL_CONF=~/.pydistutil.cfg + +if [ "x$BASE_PIP_URL" = "x" ];then + exit 0 +fi + +echo "config pip and easy_install" +HOSTNAME=`echo $BASE_PIP_URL | awk -F '[:/]' '{print $4}'` +if [ "x$HOSTNAME" = "x" ]; then + echo "invalid BASE_PIP_URL: $BASE_PIP_URL" + exit 1 +fi + +if [ ! -d $PIP_PATH ];then + mkdir $PIP_PATH +fi + +echo -e "[global]\ntrusted-host = $HOSTNAME\nindex-url = $BASE_PIP_URL\ntimeout = 6000" > $PIP_CONF +echo -e "[easy_install]\nindex-url = $BASE_PIP_URL\nfind-links = $BASE_PIP_URL" > $EASY_INSTALL_CONF + |