Commit 2f422104 authored by Carlos Torres's avatar Carlos Torres
Browse files

Merge branch 'hotfix/add_shimmercat_ports_to_create_deployment' into 'develop'

Adding shimmercat ports to create deployment

See merge request !43
parents 78c9e291 fdeed666
- 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,
shimmercat_listen_port,
shimmercat_http2https_port,
description='',
tags=''
):
"""
Will create a deployment site instance on our cloud environment, and return
a dict with the:
......@@ -17,6 +23,8 @@ def create_deployment_site(authentication_token, description='', tags=''):
- deployment_site_long_secret
:param authentication_token:
:param shimmercat_listen_port:
:param shimmercat_http2https_port:
:param description:
:param tags:
:return:
......@@ -25,7 +33,12 @@ def create_deployment_site(authentication_token, description='', tags=''):
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",
......@@ -103,6 +119,8 @@ def main():
if create_deployment:
deployment_data = create_deployment_site(
auth_token,
args.shimmercat_listen_port,
args.shimmercat_http2https_port,
description=description,
tags=deployment_tags
)
......
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