From 61fbce5d7e1da8613e2825dabf7cc69ed015d0d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20Mass=C3=A9?= Date: Fri, 21 Jun 2019 12:13:08 +0200 Subject: [PATCH] add doc --- README.md | 16 ++++++++++++- testcase-04/setup.yaml | 54 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 69 insertions(+), 1 deletion(-) create mode 100644 testcase-04/setup.yaml diff --git a/README.md b/README.md index 35a661e..c340c6c 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,7 @@ Create a secret that contains all your [3scale remotes](https://github.com/3scal oc create secret generic 3scale-toolbox --from-file=$HOME/.3scalerc.yaml ``` -Deploy the sample API Backend: +Deploy the sample Beer Catalog API Backend (used by the first three usecases): ```sh oc project api-lifecycle @@ -31,6 +31,14 @@ oc new-app -i openshift/redhat-openjdk18-openshift:1.4 https://github.com/microc oc expose svc/beer-catalog --hostname=beer-catalog.app.itix.fr ``` +Deploy the sample Red Hat Event API Backend (used by the subsequent usecases): + +```sh +oc project api-lifecycle +oc new-app -i openshift/nodejs:10 'https://github.com/nmasse-itix/rhte-api.git#085b015' --name=event-api +oc expose svc/event-api --hostname=event-api.app.itix.fr +``` + Deploy APIcast instances to be used in APIcast self-managed instances: ```sh @@ -87,3 +95,9 @@ oc process -f testcase-03/setup.yaml -p DEVELOPER_ACCOUNT_ID=2445582535751 -p PR ```sh oc process -f testcase-03/setup.yaml -p DEVELOPER_ACCOUNT_ID=5 -p PRIVATE_BASE_URL=http://beer-catalog.app.itix.fr -p TARGET_INSTANCE=3scale-onprem -p PUBLIC_STAGING_WILDCARD_DOMAIN=onprem-staging.app.itix.fr -p PUBLIC_PRODUCTION_WILDCARD_DOMAIN=onprem-production.app.itix.fr -p DISABLE_TLS_VALIDATION=yes -p OIDC_ISSUER_ENDPOINT=https://$CLIENT_ID:$CLIENT_SECRET@$SSO_HOSTNAME/auth/realms/$REALM |oc create -f - ``` + +### Usecase 03: Deploy an API in three environments, all in one tenant + +```sh +oc process -f testcase-04/setup.yaml -p DEVELOPER_ACCOUNT_ID=2445582535751 -p PRIVATE_BASE_URL=http://event-api.app.itix.fr -p PUBLIC_STAGING_WILDCARD_DOMAIN=nmasse-redhat-staging.app.itix.fr -p PUBLIC_PRODUCTION_WILDCARD_DOMAIN=nmasse-redhat-production.app.itix.fr |oc create -f - +``` diff --git a/testcase-04/setup.yaml b/testcase-04/setup.yaml new file mode 100644 index 0000000..45b13e8 --- /dev/null +++ b/testcase-04/setup.yaml @@ -0,0 +1,54 @@ +apiVersion: v1 +kind: Template +metadata: + name: testcase-04 +objects: +- kind: "BuildConfig" + apiVersion: "v1" + metadata: + name: "testcase-04-${TARGET_INSTANCE}" + namespace: ${NAMESPACE} + spec: + source: + git: + uri: ${GIT_REPO} + strategy: + type: "JenkinsPipeline" + jenkinsPipelineStrategy: + jenkinsfilePath: testcase-04/Jenkinsfile + env: + - name: SECRET_NAME + value: ${SECRET_NAME} + - name: NAMESPACE + value: ${NAMESPACE} + - name: TARGET_INSTANCE + value: ${TARGET_INSTANCE} + - name: PUBLIC_STAGING_WILDCARD_DOMAIN + value: ${PUBLIC_STAGING_WILDCARD_DOMAIN} + - name: PUBLIC_PRODUCTION_WILDCARD_DOMAIN + value: ${PUBLIC_PRODUCTION_WILDCARD_DOMAIN} + - name: DEVELOPER_ACCOUNT_ID + value: ${DEVELOPER_ACCOUNT_ID} + - name: PRIVATE_BASE_URL + value: ${PRIVATE_BASE_URL} + - name: DISABLE_TLS_VALIDATION + value: ${DISABLE_TLS_VALIDATION} +parameters: +- name: SECRET_NAME + value: 3scale-toolbox +- name: NAMESPACE + value: api-lifecycle +- name: TARGET_INSTANCE + value: 3scale-saas +- name: GIT_REPO + value: https://github.com/nmasse-itix/API-Lifecycle-Mockup.git +- name: PUBLIC_STAGING_WILDCARD_DOMAIN + required: false +- name: PUBLIC_PRODUCTION_WILDCARD_DOMAIN + required: false +- name: DEVELOPER_ACCOUNT_ID + required: true +- name: PRIVATE_BASE_URL + required: true +- name: DISABLE_TLS_VALIDATION + value: "no"