summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJose Lausuch <jose.lausuch@ericsson.com>2017-07-06 07:11:40 +0000
committerGerrit Code Review <gerrit@opnfv.org>2017-07-06 07:11:40 +0000
commit1cb29bd339f434caffc4e0724f93d0bdefc2e281 (patch)
treef9f065e5fc51b21e53387f69be6e49c383560a4e
parentbb24c3d6c42c7b74ae8ea2fb9f390ff1f7fd7dbf (diff)
parent3e7bd0b894b347699226ba3df2104d7d2913362f (diff)
Merge "bugfix: hardcoded testapi urls"
-rw-r--r--jjb/releng/automate.yml2
-rw-r--r--utils/test/testapi/3rd_party/static/testapi-ui/config.json2
-rw-r--r--utils/test/testapi/deployment/deploy.py10
-rw-r--r--utils/test/testapi/deployment/docker-compose.yml.template2
-rw-r--r--utils/test/testapi/docker/Dockerfile2
-rwxr-xr-xutils/test/testapi/docker/prepare-env.sh8
-rw-r--r--utils/test/testapi/etc/config.ini4
7 files changed, 17 insertions, 13 deletions
diff --git a/jjb/releng/automate.yml b/jjb/releng/automate.yml
index 9eb281de3..4bea7032c 100644
--- a/jjb/releng/automate.yml
+++ b/jjb/releng/automate.yml
@@ -247,7 +247,7 @@
name: 'testapi-automate-docker-deploy-macro'
builders:
- shell: |
- bash ./jjb/releng/docker-deploy.sh 'sudo docker run -dti -p 8082:8000 -e mongodb_url=mongodb://172.17.0.1:27017 -e swagger_url=http://testresults.opnfv.org/test opnfv/testapi' "http://testresults.opnfv.org/test/swagger/APIs"
+ bash ./jjb/releng/docker-deploy.sh 'sudo docker run -dti -p 8082:8000 -e mongodb_url=mongodb://172.17.0.1:27017 -e base_url=http://testresults.opnfv.org/test opnfv/testapi' "http://testresults.opnfv.org/test/swagger/APIs"
- builder:
name: 'reporting-automate-docker-deploy-macro'
builders:
diff --git a/utils/test/testapi/3rd_party/static/testapi-ui/config.json b/utils/test/testapi/3rd_party/static/testapi-ui/config.json
index 9fdd85fbb..5d48c7b12 100644
--- a/utils/test/testapi/3rd_party/static/testapi-ui/config.json
+++ b/utils/test/testapi/3rd_party/static/testapi-ui/config.json
@@ -1 +1 @@
-{"testapiApiUrl": "http://testresults.opnfv.org/test/api/v1"}
+{"testapiApiUrl": "http://localhost:8000/api/v1"}
diff --git a/utils/test/testapi/deployment/deploy.py b/utils/test/testapi/deployment/deploy.py
index 748bd34f8..6433fa6b2 100644
--- a/utils/test/testapi/deployment/deploy.py
+++ b/utils/test/testapi/deployment/deploy.py
@@ -8,10 +8,10 @@ docker_compose_yml = './docker-compose.yml'
docker_compose_template = './docker-compose.yml.template'
-def render_docker_compose(port, swagger_url):
+def render_docker_compose(port, base_url):
vars = {
"expose_port": port,
- "swagger_url": swagger_url,
+ "base_url": base_url,
}
template = env.get_template(docker_compose_template)
yml = template.render(vars=vars)
@@ -22,7 +22,7 @@ def render_docker_compose(port, swagger_url):
def main(args):
- render_docker_compose(args.expose_port, args.swagger_url)
+ render_docker_compose(args.expose_port, args.base_url)
os.system('docker-compose -f {} up -d'.format(docker_compose_yml))
@@ -33,8 +33,8 @@ if __name__ == '__main__':
required=False,
default=8000,
help='testapi exposed port')
- parser.add_argument('-su', '--swagger-url',
+ parser.add_argument('-l', '--base-url',
type=str,
required=True,
- help='testapi exposed swagger-url')
+ help='testapi exposed base-url')
main(parser.parse_args())
diff --git a/utils/test/testapi/deployment/docker-compose.yml.template b/utils/test/testapi/deployment/docker-compose.yml.template
index 5b131f747..cd684048e 100644
--- a/utils/test/testapi/deployment/docker-compose.yml.template
+++ b/utils/test/testapi/deployment/docker-compose.yml.template
@@ -8,7 +8,7 @@ services:
container_name: opnfv-testapi
environment:
- mongodb_url=mongodb://mongo:27017/
- - swagger_url={{ vars.swagger_url }}
+ - base_url={{ vars.base_url }}
ports:
- "{{ vars.expose_port }}:8000"
links:
diff --git a/utils/test/testapi/docker/Dockerfile b/utils/test/testapi/docker/Dockerfile
index e031e194c..5311f35b8 100644
--- a/utils/test/testapi/docker/Dockerfile
+++ b/utils/test/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/utils/test/testapi/docker/prepare-env.sh b/utils/test/testapi/docker/prepare-env.sh
index 9f07efbd1..4f1be7d6a 100755
--- a/utils/test/testapi/docker/prepare-env.sh
+++ b/utils/test/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
diff --git a/utils/test/testapi/etc/config.ini b/utils/test/testapi/etc/config.ini
index dad59d2d0..9ae25209d 100644
--- a/utils/test/testapi/etc/config.ini
+++ b/utils/test/testapi/etc/config.ini
@@ -8,7 +8,7 @@ dbname = test_results_collection
[api]
# Listening port
-url = http://testresults.opnfv.org/test/api/v1
+url = http://localhost:8000/api/v1
port = 8000
# Number of results for one page (integer value)
@@ -22,7 +22,7 @@ authenticate = False
base_url = http://localhost:8000
[ui]
-url = http://testresults.opnfv.org/test
+url = http://localhost:8000
[osid]