summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSerenaFeng <feng.xiaoewi@zte.com.cn>2016-04-07 23:34:00 -0400
committerSerena Feng <feng.xiaowei@zte.com.cn>2016-04-12 08:15:38 +0000
commit7c5eb08436bb85f499eb0e84be759f11deb1f404 (patch)
treed07db03a03a4f7a4ee8586fdafa9fb3cecfe79a6
parent4830cbe462c1081906292b027073644904e42970 (diff)
add bash script to config pip and easy_install
JIRA: FUNCTEST-139 Change-Id: Iec0c1d0315ded19286fa2df8478567f4cda194b4 Signed-off-by: SerenaFeng <feng.xiaoewi@zte.com.cn>
-rw-r--r--docker/config_install_env.sh26
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 000000000..ed67994f0
--- /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
+