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.

2.1 KiB

Library API

Setup

Deploy 3scale 2.8.

Deploy Red Hat SSO.

Configure Red Hat SSO for 3scale.

Patch your APIcast to enable CORS globally.

Create a project and deploy the Library API Backend.

oc new-project library-api
oc import-image -n openshift openjdk-8-rhel8 --from=registry.redhat.io/openjdk/openjdk-8-rhel8 --confirm --reference-policy=local
oc new-app -n library-api -i openjdk-8-rhel8 https://github.com/nmasse-itix/library-api.git --name=library-api
oc expose -n library-api svc/library-api --hostname="library-api.apps.ocp4.itix.fr"

Deploy a Jenkins master.

oc new-app -n library-api --template=jenkins-ephemeral --name=jenkins -p MEMORY_LIMIT=2Gi
oc set env -n library-api dc/jenkins JENKINS_OPTS=--sessionTimeout=86400

Create a secret containing your 3scale toolbox remotes.

oc create -n library-api secret generic 3scale-toolbox --from-file="$HOME/.3scalerc.yaml"

Add a new Build Config to run the Jenkins pipeline.

oc new-build -n library-api --strategy=pipeline --name=library-pipeline https://github.com/nmasse-itix/library-api.git -e PRIVATE_BASE_URL=http://library-api.apps.ocp4.itix.fr -e NAMESPACE=library-api -e TARGET_INSTANCE=3scale-saas -e SECRET_NAME=3scale-toolbox -e OIDC_ISSUER_ENDPOINT=https://zync:[REDACTED]@sso.apps.ocp4.itix.fr/auth/realms/3scale-saas -e DISABLE_TLS_VALIDATION=yes -e MOCK_SERVER=https://microcks.apps.ocp4.itix.fr -e MOCK_URL=/rest/Library+API/0.9.0

Reset

Remove the Jenkins pipeline:

oc delete -n library-api bc/library-pipeline

Remove the 3scale services:

ansible-playbook cleanup/cleanup.yml -e admin_portal_hostname=[TENANT]-admin.3scale.net -e threescale_token=[REDACTED]

Go to the Apicurio Studio and remove the Library service.

Go to the Microcks console and remove the Library service.

Set the OpenAPI Specification file back to version 0.9:

mv api-contracts/openapi-0.9.json openapi.json
git add openapi.json
git commit -m 'reset the demo'
git push