From 68cee3ecf13b190b149b08e525d4d7772e513bf5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20Mass=C3=A9?= Date: Tue, 5 Mar 2019 16:41:17 +0100 Subject: [PATCH] rename a param --- support/awx/README.md | 2 +- support/docker/deploy-api.yaml | 10 ++++------ support/docker/openshift-template.yaml | 2 +- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/support/awx/README.md b/support/awx/README.md index 357b029..2aaf926 100644 --- a/support/awx/README.md +++ b/support/awx/README.md @@ -28,7 +28,7 @@ You can now provision an API from your favourite CI/CD tool. For example, from J def towerExtraVars = [ git_repository: "https://github.com/nmasse-itix/rhte-api.git", git_ref: "master", - threescale_cicd_openapi_file: "openapi-spec.yaml", + openapi_file: "openapi-spec.yaml", threescale_cicd_api_base_system_name: "event_api", threescale_cicd_private_base_url: "https://echo-api.3scale.net", threescale_cicd_api_environment_name: "prod", diff --git a/support/docker/deploy-api.yaml b/support/docker/deploy-api.yaml index 4484584..de50b44 100644 --- a/support/docker/deploy-api.yaml +++ b/support/docker/deploy-api.yaml @@ -66,13 +66,16 @@ git_repository: '{{ build.spec.source.git.uri if ''spec'' in build and ''uri'' in build.spec.source.git else '''' }}' git_context_dir: '{{ build.spec.source.git.contextDir if ''spec'' in build and ''contextDir'' in build.spec.source.git else '''' }}' git_ref: '{{ build.spec.source.git.ref if ''spec'' in build and ''ref'' in build.spec.source.git else ''master'' }}' + openapi_file: openapi-spec.yaml ansible_connection: local + threescale_cicd_openapi_file: '{{ playbook_dir ~ "/api/" ~ git_context_dir ~ "/" ~ openapi_file if git_repository|length > 0 else playbook_dir ~ "/api/" ~ openapi_file }}' parameter_whitelist: - git_repository - git_ref - git_context_dir - - threescale_cicd_openapi_file + - openapi_file # relative path to the OpenAPI file + - threescale_cicd_openapi_file # absolute path to the OpenAPI file - threescale_cicd_openapi_file_format - threescale_cicd_api_system_name - threescale_cicd_api_base_system_name @@ -108,11 +111,6 @@ with_items: '{{ parameter_whitelist }}' when: 'lookup(''env'', item|upper)|length > 0' - - name: Add the contextDir to the OpenAPI file path - set_fact: - threescale_cicd_openapi_file: '{{ playbook_dir }}/api/{{ git_context_dir }}/{{ threescale_cicd_openapi_file }}' - when: 'git_repository|length > 0' - - name: Check if /tmp/secrets/sso_issuer_endpoint exists stat: path: /tmp/secrets/sso_issuer_endpoint diff --git a/support/docker/openshift-template.yaml b/support/docker/openshift-template.yaml index 50cbae2..480cfea 100644 --- a/support/docker/openshift-template.yaml +++ b/support/docker/openshift-template.yaml @@ -126,7 +126,7 @@ objects: env: - name: THREESCALE_CICD_OPENAPI_FILE_FORMAT value: ${API_OPENAPI_FILE_FORMAT} - - name: THREESCALE_CICD_OPENAPI_FILE + - name: OPENAPI_FILE value: ${API_OPENAPI_FILE} - name: THREESCALE_CICD_API_BASE_SYSTEM_NAME value: ${API_NAME}