Browse Source

deploy the OAuth test client

master
Nicolas Massé 9 years ago
parent
commit
04acad79ad
  1. 44
      roles/3scale/tasks/oauth-client.yml
  2. 5
      roles/3scale/tasks/post-install.yml

44
roles/3scale/tasks/oauth-client.yml

@ -0,0 +1,44 @@
---
- include: "common/status.yml"
vars:
project: "{{ threescale_project }}"
tags: status
- set_fact:
deploy_needed: '{{ deployment_configs|intersect([ "oauth-client" ])|length < 1 }}'
tags: status
- name: Get APICast (staging) URL
command: oc get route api-apicast-staging-route -n "{{ threescale_project }}" -o 'jsonpath={.spec.host}'
register: route
changed_when: false
when: deploy_needed
tags: status
- set_fact:
apicast_hostname: '{{ route.stdout }}'
tags: vars
when: deploy_needed
- name: Deploy the OAuth client
command: oc new-app -n '{{ threescale_project }}' https://github.com/3scale/apicast.git --name=oauth-client --context-dir=/examples/oauth2/client/ -e GATEWAY='https://{{ apicast_hostname }}'
when: deploy_needed
- name: Expose the OAuth client
command: oc expose service oauth-client -n '{{ threescale_project }}'
when: deploy_needed
- name: Get OAuth client URL
command: oc get route oauth-client -n "{{ threescale_project }}" -o 'jsonpath={.spec.host}'
register: route
changed_when: false
tags: status
- set_fact:
oauth_client_hostname: '{{ route.stdout }}'
tags: vars
- name: Patch the DeploymentConfig to add the REDIRECT_URI variable
command: oc env dc/oauth-client REDIRECT_URI='http://{{ oauth_client_hostname }}/callback'
when: deploy_needed

5
roles/3scale/tasks/post-install.yml

@ -11,6 +11,9 @@
tags: vars tags: vars
- include: 3scale_status.yml - include: 3scale_status.yml
- include: create_api.yml - include: create_api.yml
with_items: '{{ threescale_apis_to_create }}' with_items: '{{ threescale_apis_to_create }}'
- include: oauth-client.yml
tags: oauth-client

Loading…
Cancel
Save