You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
53 lines
3.7 KiB
53 lines
3.7 KiB
---
|
|
|
|
- name: Deploy the Beer Catalog API in multi environment
|
|
hosts: threescale
|
|
gather_facts: no
|
|
vars:
|
|
threescale_cicd_openapi_file: '{{ playbook_dir }}/api-contracts/beer-catalog-api.json'
|
|
threescale_cicd_openapi_file_format: 'JSON'
|
|
threescale_cicd_api_backend_hostname: echo-api.3scale.net
|
|
threescale_cicd_openapi_smoketest_operation: GET_beer
|
|
tasks:
|
|
- name: Generate a random system_name for this test run
|
|
import_tasks: "common/random-system-name.yml"
|
|
|
|
# Deploy in DEV
|
|
- import_role:
|
|
name: 'nmasse-itix.threescale-cicd'
|
|
vars:
|
|
threescale_cicd_api_environment_name: dev
|
|
threescale_cicd_apicast_sandbox_endpoint: '{{ threescale_cicd_default_apicast_scheme }}://{{ (threescale_cicd_api_environment_name ~ "-" ~ threescale_cicd_api_base_system_name ~ "-" ~ threescale_cicd_api_version_major)|regex_replace(''[^a-zA-Z0-9-]+'', ''-'')|lower }}{{ threescale_cicd_default_staging_suffix }}.{{ apicast_staging_domain|default(threescale_cicd_wildcard_domain) }}'
|
|
threescale_cicd_apicast_production_endpoint: '{{ threescale_cicd_default_apicast_scheme }}://{{ (threescale_cicd_api_environment_name ~ "-" ~threescale_cicd_api_base_system_name ~ "-" ~ threescale_cicd_api_version_major)|regex_replace(''[^a-zA-Z0-9-]+'', ''-'')|lower }}{{ threescale_cicd_default_production_suffix }}.{{ apicast_production_domain|default(threescale_cicd_wildcard_domain) }}'
|
|
# Deploy in TEST
|
|
- import_role:
|
|
name: 'nmasse-itix.threescale-cicd'
|
|
vars:
|
|
threescale_cicd_api_environment_name: test
|
|
threescale_cicd_apicast_sandbox_endpoint: '{{ threescale_cicd_default_apicast_scheme }}://{{ (threescale_cicd_api_environment_name ~ "-" ~ threescale_cicd_api_base_system_name ~ "-" ~ threescale_cicd_api_version_major)|regex_replace(''[^a-zA-Z0-9-]+'', ''-'')|lower }}{{ threescale_cicd_default_staging_suffix }}.{{ apicast_staging_domain|default(threescale_cicd_wildcard_domain) }}'
|
|
threescale_cicd_apicast_production_endpoint: '{{ threescale_cicd_default_apicast_scheme }}://{{ (threescale_cicd_api_environment_name ~ "-" ~threescale_cicd_api_base_system_name ~ "-" ~ threescale_cicd_api_version_major)|regex_replace(''[^a-zA-Z0-9-]+'', ''-'')|lower }}{{ threescale_cicd_default_production_suffix }}.{{ apicast_production_domain|default(threescale_cicd_wildcard_domain) }}'
|
|
# Deploy in PROD
|
|
- import_role:
|
|
name: 'nmasse-itix.threescale-cicd'
|
|
vars:
|
|
threescale_cicd_api_environment_name: prod
|
|
threescale_cicd_apicast_sandbox_endpoint: '{{ threescale_cicd_default_apicast_scheme }}://{{ (threescale_cicd_api_environment_name ~ "-" ~ threescale_cicd_api_base_system_name ~ "-" ~ threescale_cicd_api_version_major)|regex_replace(''[^a-zA-Z0-9-]+'', ''-'')|lower }}{{ threescale_cicd_default_staging_suffix }}.{{ apicast_staging_domain|default(threescale_cicd_wildcard_domain) }}'
|
|
threescale_cicd_apicast_production_endpoint: '{{ threescale_cicd_default_apicast_scheme }}://{{ (threescale_cicd_api_environment_name ~ "-" ~threescale_cicd_api_base_system_name ~ "-" ~ threescale_cicd_api_version_major)|regex_replace(''[^a-zA-Z0-9-]+'', ''-'')|lower }}{{ threescale_cicd_default_production_suffix }}.{{ apicast_production_domain|default(threescale_cicd_wildcard_domain) }}'
|
|
# Cleanup the DEV
|
|
- import_role:
|
|
name: 'nmasse-itix.threescale-cicd'
|
|
tasks_from: 'cleanup'
|
|
vars:
|
|
threescale_cicd_api_environment_name: dev
|
|
# Cleanup the TEST
|
|
- import_role:
|
|
name: 'nmasse-itix.threescale-cicd'
|
|
tasks_from: 'cleanup'
|
|
vars:
|
|
threescale_cicd_api_environment_name: test
|
|
# Cleanup the PROD
|
|
- import_role:
|
|
name: 'nmasse-itix.threescale-cicd'
|
|
tasks_from: 'cleanup'
|
|
vars:
|
|
threescale_cicd_api_environment_name: prod
|
|
|