Browse Source

see #29: put the cors policy higher in the stack

pull/38/head
Nicolas Massé 7 years ago
parent
commit
c457306869
  1. 13
      tasks/api-calls/smoke_test.yml
  2. 17
      tests/3scale-saas-with-hosted-apicast-with-cors-policy.yml
  3. 2
      vars/main.yml

13
tasks/api-calls/smoke_test.yml

@ -18,3 +18,16 @@
delay: '{{ threescale_cicd_delay }}'
# temporary fix for https://github.com/ansible/ansible/issues/28078
until: 'threescale_cicd_tmpresponse is success'
- name: Running smoke tests (CORS) !
uri:
url: '{{ threescale_cicd_smoke_test_url }}'
headers: '{{ threescale_cicd_smoke_test_headers|combine({ ''Origin'': threescale_cicd_smoke_test_url}) }}'
validate_certs: no
method: OPTIONS
register: threescale_cicd_tmpresponse
retries: '{{ threescale_cicd_retries }}'
delay: '{{ threescale_cicd_delay }}'
# temporary fix for https://github.com/ansible/ansible/issues/28078
until: 'threescale_cicd_tmpresponse is success'
when: 'threescale_cicd_apicast_policies_cors|bool'

17
tests/3scale-saas-with-hosted-apicast-with-cors-policy.yml

@ -0,0 +1,17 @@
---
- name: Deploy the Echo API to a 3scale SaaS instance, with hosted APIcasts and no smoketests
hosts: threescale
gather_facts: no
vars:
threescale_cicd_openapi_smoketest_operation: Echo
threescale_cicd_apicast_policies_cors: yes
threescale_cicd_openapi_file: '{{ playbook_dir }}/api/echo-api-bare.yaml'
tasks:
# Deploy the service
- import_role:
name: 'nmasse-itix.threescale-cicd'
# Delete the service
- import_role:
name: 'nmasse-itix.threescale-cicd'
tasks_from: 'cleanup'

2
vars/main.yml

@ -75,7 +75,7 @@ threescale_cicd_wanted_policies: '{{ lookup(''template'', ''wanted_policies.j2''
## what we have
threescale_cicd_existing_policies: '{{ lookup(''template'', ''existing_policies.j2'') }}'
# update the items that we want and we have
threescale_cicd_policies_to_update: '{{ threescale_cicd_existing_policies|union(threescale_cicd_wanted_policies) }}'
threescale_cicd_policies_to_update: '{{ threescale_cicd_wanted_policies|union(threescale_cicd_existing_policies) }}'
##
## 3scale API Payload definition

Loading…
Cancel
Save