Commit d93fed04 authored by Carlos Torres's avatar Carlos Torres
Browse files

Adding shimmercat ports to create deployment

parent 78c9e291
- name: Create credentials without deploy
shell: source /srv/accelerator_client/venv/bin/activate && cloud_credentials --install_dirs "{{ sc_pack_config_dir_list }}" --auth-token {{ api_access_token }} --domains "{{ domains }}" --deployment-tags "{{ deployment_tags }}" --do-not-create-deployment
shell: source /srv/accelerator_client/venv/bin/activate && cloud_credentials --shimmercat_listen_port "{{ item.value.https_port }}" --shimmercat_http2https_port "{{ item.value.http_port }}" --install_dirs "['/srv/inventory/{{ item.value.deployment_name }}']" --auth-token {{ api_access_token }} --domains "{{ domains }}" --deployment-tags "{{ deployment_tags }}" --do-not-create-deployment
register: shell_result
args:
executable: /bin/bash
when: "False == create_deployment"
- name: Create credentials with deploy
shell: source /srv/accelerator_client/venv/bin/activate && cloud_credentials --install_dirs "{{ sc_pack_config_dir_list }}" --auth-token {{ api_access_token }} --domains "{{ domains }}" --deployment-tags "{{ deployment_tags }}"
shell: source /srv/accelerator_client/venv/bin/activate && cloud_credentials --shimmercat_listen_port "{{ item.value.https_port }}" --shimmercat_http2https_port "{{ item.value.http_port }}" --install_dirs "['/srv/inventory/{{ item.value.deployment_name }}']" --auth-token {{ api_access_token }} --domains "{{ domains }}" --deployment-tags "{{ deployment_tags }}"
register: shell_result
args:
executable: /bin/bash
......
......@@ -61,6 +61,7 @@
- name: Create credentials
include_tasks: "{{ role_path }}/tasks/credentials.yml"
with_dict: "{{ deployments }}"
- name: Create deployments
script: "{{ role_path }}/files/create_deploy.sh {{ item.value.deployment_name | replace('.', '_') }} {{installers_dir}} {{item.value.install_dir}} {{item.value.http_port}} {{item.value.https_port}} {{item.value.humanity_validator_port}} {{ api_access_token }}"
......
- name: Create credentials without deploy
shell: source /srv/accelerator_client/venv/bin/activate && cloud_credentials --install_dirs "{{ sc_pack_config_dir_list }}" --auth-token {{ api_access_token }} --domains "{{ domains }}" --deployment-tags "{{ deployment_tags }}" --do-not-create-deployment
shell: source /srv/accelerator_client/venv/bin/activate && cloud_credentials --shimmercat_listen_port "{{ item.value.https_port }}" --shimmercat_http2https_port "{{ item.value.http_port }}" --install_dirs "['/srv/inventory/{{ item.value.deployment_name }}']" --auth-token {{ api_access_token }} --domains "{{ domains }}" --deployment-tags "{{ deployment_tags }}" --do-not-create-deployment
register: shell_result
args:
executable: /bin/bash
when: "False == create_deployment"
- name: Create credentials with deploy
shell: source /srv/accelerator_client/venv/bin/activate && cloud_credentials --install_dirs "{{ sc_pack_config_dir_list }}" --auth-token {{ api_access_token }} --domains "{{ domains }}" --deployment-tags "{{ deployment_tags }}"
shell: source /srv/accelerator_client/venv/bin/activate && cloud_credentials --shimmercat_listen_port "{{ item.value.https_port }}" --shimmercat_http2https_port "{{ item.value.http_port }}" --install_dirs "['/srv/inventory/{{ item.value.deployment_name }}']" --auth-token {{ api_access_token }} --domains "{{ domains }}" --deployment-tags "{{ deployment_tags }}"
register: shell_result
args:
executable: /bin/bash
......
......@@ -61,6 +61,7 @@
- name: Create credentials
include_tasks: "{{ role_path }}/tasks/credentials.yml"
with_dict: "{{ deployments }}"
- name: Create deployments
script: "{{ role_path }}/files/create_deploy.sh {{ item.value.deployment_name | replace('.', '_') }} {{installers_dir}} {{item.value.install_dir}} {{item.value.http_port}} {{item.value.https_port}} {{item.value.humanity_validator_port}} {{ api_access_token }}"
......
......@@ -8,7 +8,13 @@ from cloud_credentials import constants
DEFAULT_REQUESTS_TIMEOUT = 300 # In seconds
def create_deployment_site(authentication_token, description='', tags=''):
def create_deployment_site(
authentication_token,
description='',
tags='',
shimmercat_listen_port,
shimmercat_http2https_port
):
"""
Will create a deployment site instance on our cloud environment, and return
a dict with the:
......@@ -19,13 +25,20 @@ def create_deployment_site(authentication_token, description='', tags=''):
:param authentication_token:
:param description:
:param tags:
:param shimmercat_listen_port:
:param shimmercat_http2https_port:
:return:
"""
url = '{}{}/'.format(constants.ACCELERATOR_BASE_URL, 'deployment-site')
try:
response = requests.post(
url,
json={'description': description, 'tags': tags},
json={
'description': description,
'tags': tags,
'shimmercat_listen_port': shimmercat_listen_port,
'shimmercat_http2https_port': shimmercat_http2https_port
},
headers={
'Authorization': 'Token {}'.format(
authentication_token
......
......@@ -25,6 +25,22 @@ from cloud_credentials.accelerator_utils import (
def main():
parser = argparse.ArgumentParser()
parser.add_argument(
"-l",
"--shimmercat_listen_port",
dest="shimmercat_listen_port",
help=(
"Shimmercat's listen port."
)
)
parser.add_argument(
"-p",
"--shimmercat_http2https_port",
dest="shimmercat_http2https_port",
help=(
"Shimmercat's http to https port."
)
)
parser.add_argument(
"-i",
"--install_dirs",
......@@ -104,8 +120,11 @@ def main():
deployment_data = create_deployment_site(
auth_token,
description=description,
tags=deployment_tags
tags=deployment_tags,
shimmercat_listen_port,
shimmercat_http2https_port
)
###todo
if deployment_data and 'error' not in deployment_data.keys():
deployment_id = deployment_data['deployment_id']
link_deployment_site_to_domains(
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment