summaryrefslogtreecommitdiffstats
path: root/utils/test/opts/one_click_deploy.py
diff options
context:
space:
mode:
authorTrevor Bramwell <tbramwell@linuxfoundation.org>2017-11-21 00:46:35 +0000
committerGerrit Code Review <gerrit@opnfv.org>2017-11-21 00:46:35 +0000
commit174b299271189496bae4c4d6727ea26a7a098756 (patch)
treeb063e18c795988e38e1eb4afa74d4cbf9524f057 /utils/test/opts/one_click_deploy.py
parentfd65ec9e84ae025e6b903c403514405ba0bb0a61 (diff)
parentf11f26d23dabde24b0bcd67ac81b094aa89eb6c9 (diff)
Merge "Remove 'utils/test' Directory and update INFO"
Diffstat (limited to 'utils/test/opts/one_click_deploy.py')
-rw-r--r--utils/test/opts/one_click_deploy.py67
1 files changed, 0 insertions, 67 deletions
diff --git a/utils/test/opts/one_click_deploy.py b/utils/test/opts/one_click_deploy.py
deleted file mode 100644
index 074827021..000000000
--- a/utils/test/opts/one_click_deploy.py
+++ /dev/null
@@ -1,67 +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.base_url }}
- ports:
- - "{{ vars.testapi_port }}:8000"
- links:
- - mongo
- reporting:
- image: opnfv/reporting:latest
- container_name: opnfv-reporting
- ports:
- - "{{ vars.reporting_port }}:8000"
-"""
-
-
-def render_docker_compose(testapi_port, reporting_port, testapi_base_url):
- vars = {
- "testapi_port": testapi_port,
- "reporting_port": reporting_port,
- "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.reporting_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=8082,
- help='testapi exposed port')
- parser.add_argument('-tl', '--testapi-base-url',
- type=str,
- required=True,
- help='testapi exposed base-url')
- parser.add_argument('-rp', '--reporting-port',
- type=int,
- required=False,
- default=8084,
- help='reporting exposed port')
-
- main(parser.parse_args())