diff options
author | SerenaFeng <feng.xiaowei@zte.com.cn> | 2017-07-05 16:20:54 +0800 |
---|---|---|
committer | SerenaFeng <feng.xiaowei@zte.com.cn> | 2017-07-05 16:29:16 +0800 |
commit | 79f400f880bc6e5d40defef9d6c8b134d91958a1 (patch) | |
tree | c07382a4c946623fd65b0c5d5dea27ce8eb86032 /testapi/docker | |
parent | 1da5990f3e25c375757349b30b4f47d288775682 (diff) |
bugfix: hardcoded testapi urls
testapi webportal's urls are fixed in configure files
this patch aims to modify them according to base_url
provided when bringing up container
Change-Id: I29c461fc3b837e54d4ff5330dcaa520637590ff7
Signed-off-by: SerenaFeng <feng.xiaowei@zte.com.cn>
Diffstat (limited to 'testapi/docker')
-rw-r--r-- | testapi/docker/Dockerfile | 2 | ||||
-rwxr-xr-x | testapi/docker/prepare-env.sh | 8 |
2 files changed, 7 insertions, 3 deletions
diff --git a/testapi/docker/Dockerfile b/testapi/docker/Dockerfile index e031e19..5311f35 100644 --- a/testapi/docker/Dockerfile +++ b/testapi/docker/Dockerfile @@ -9,7 +9,7 @@ # # Execution: # $ docker run -dti -p 8001:8000 \ -# -e "swagger_url=http://10.63.243.17:8001" \ +# -e "base_url=http://10.63.243.17:8001" \ # -e "mongodb_url=mongodb://10.63.243.17:27017/" \ # opnfv/testapi:tag # diff --git a/testapi/docker/prepare-env.sh b/testapi/docker/prepare-env.sh index 9f07efb..4f1be7d 100755 --- a/testapi/docker/prepare-env.sh +++ b/testapi/docker/prepare-env.sh @@ -6,6 +6,10 @@ if [ "$mongodb_url" != "" ]; then sudo crudini --set --existing $FILE mongo url $mongodb_url fi -if [ "$swagger_url" != "" ]; then - sudo crudini --set --existing $FILE swagger base_url $swagger_url +if [ "$base_url" != "" ]; then + sudo crudini --set --existing $FILE api url $base_url/api/v1 + sudo crudini --set --existing $FILE swagger base_url $base_url + sudo crudini --set --existing $FILE ui url $base_url + sudo echo "{\"testapiApiUrl\": \"$base_url/api/v1\"}" > \ + /usr/local/lib/python2.7/dist-packages/opnfv_testapi/static/testapi-ui/config.json fi |