summaryrefslogtreecommitdiffstats
path: root/utils/test/testapi/opts
diff options
context:
space:
mode:
authorTrevor Bramwell <tbramwell@linuxfoundation.org>2017-11-10 15:43:35 -0800
committerTrevor Bramwell <tbramwell@linuxfoundation.org>2017-11-10 15:45:32 -0800
commitf11f26d23dabde24b0bcd67ac81b094aa89eb6c9 (patch)
tree500546f6f553b049eb9ac146e7c8359d073fbf7a /utils/test/testapi/opts
parent122cf34bf3e656e1b7fa35e07dd8a71e42ed4d59 (diff)
Remove 'utils/test' Directory and update INFO
utils/test has been migrated to the releng-testresults repo Change-Id: If14a30e6abed1424d1e00b0fae048b7d869ec99b Signed-off-by: Trevor Bramwell <tbramwell@linuxfoundation.org>
Diffstat (limited to 'utils/test/testapi/opts')
-rw-r--r--utils/test/testapi/opts/deploy.py55
1 files changed, 0 insertions, 55 deletions
diff --git a/utils/test/testapi/opts/deploy.py b/utils/test/testapi/opts/deploy.py
deleted file mode 100644
index f58690c5d..000000000
--- a/utils/test/testapi/opts/deploy.py
+++ /dev/null
@@ -1,55 +0,0 @@
-import argparse
-import os
-
-from jinja2 import Environment
-
-DOCKER_COMPOSE_FILE = './docker-compose.yml'
-DOCKER_COMPOSE_TEMPLATE = """
-version: '2'
-services:
- mongo:
- image: mongo:3.2.1
- container_name: opnfv-mongo
- testapi:
- image: opnfv/testapi:latest
- container_name: opnfv-testapi
- environment:
- - mongodb_url=mongodb://mongo:27017/
- - base_url={{ vars.testapi_base_url }}
- ports:
- - "{{ vars.testapi_port }}:8000"
- links:
- - mongo
-"""
-
-
-def render_docker_compose(testapi_port, testapi_base_url):
- vars = {
- "testapi_port": testapi_port,
- "testapi_base_url": testapi_base_url,
- }
-
- yml = Environment().from_string(DOCKER_COMPOSE_TEMPLATE).render(vars=vars)
-
- with open(DOCKER_COMPOSE_FILE, 'w') as f:
- f.write(yml)
- f.close()
-
-
-def main(args):
- render_docker_compose(args.testapi_port, args.testapi_base_url)
- os.system('docker-compose -f {} up -d'.format(DOCKER_COMPOSE_FILE))
-
-
-if __name__ == '__main__':
- parser = argparse.ArgumentParser(description='Backup MongoDBs')
- parser.add_argument('-tp', '--testapi-port',
- type=int,
- required=False,
- default=8000,
- help='testapi exposed port')
- parser.add_argument('-tl', '--testapi-base-url',
- type=str,
- required=True,
- help='testapi exposed base-url')
- main(parser.parse_args())