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.
113 lines
3.4 KiB
113 lines
3.4 KiB
apiVersion: v1
|
|
kind: Template
|
|
labels:
|
|
template: deploy-3scale-api
|
|
metadata:
|
|
annotations:
|
|
description: |-
|
|
Deploy an API to 3scale
|
|
openshift.io/display-name: OpenShift BuildConfig to deploy an API to 3scale
|
|
tags: builder
|
|
template.openshift.io/documentation-url: https://github.com/nmasse-itix/threescale-cicd
|
|
template.openshift.io/long-description: OpenShift BuildConfig to deploy an API to 3scale
|
|
template.openshift.io/provider-display-name: Nicolas Massé
|
|
template.openshift.io/support-url: https://github.com/nmasse-itix/threescale-cicd/issues
|
|
name: deploy-3scale-api
|
|
parameters:
|
|
- name: API_NAME
|
|
description: 'The name of your API (subject to OpenShift name syntax: [a-zA-Z0-9_])'
|
|
value: example
|
|
required: true
|
|
- name: API_GIT_URI
|
|
description: GIT Repository containing the OpenAPI Specification to deploy
|
|
required: true
|
|
- name: API_GIT_REF
|
|
description: The branch or tag to use when checking out the GIT repository
|
|
value: master
|
|
required: true
|
|
- name: API_GIT_CONTEXT_DIR
|
|
description: The context directory to cd after the git checkout
|
|
required: false
|
|
- name: API_OPENAPI_FILE
|
|
description: The OpenAPI Specification file to use to deploy the API
|
|
value: openapi-spec.yaml
|
|
required: true
|
|
- name: API_OPENAPI_FILE_FORMAT
|
|
description: The format (JSON or YAML) of the OpenAPI Specification file
|
|
value: YAML
|
|
required: false
|
|
- name: THREESCALE_ADMIN_PORTAL_HOSTNAME
|
|
description: The hostname of the 3scale admin portal (bare hostname, without https://)
|
|
required: true
|
|
- name: THREESCALE_ADMIN_PORTAL_ACCESS_TOKEN
|
|
description: The 3scale access token
|
|
required: true
|
|
- name: SSO_ISSUER_ENDPOINT
|
|
description: For OpenID Connect APIs only, the Red Hat SSO OIDC Issuer Endpoint (https://client_id:client_secret@sso.hostname/auth/realms/my-realm)
|
|
required: false
|
|
- name: THREESCALE_CICD_VERSION
|
|
value: stable
|
|
required: true
|
|
objects:
|
|
- apiVersion: v1
|
|
kind: ImageStream
|
|
metadata:
|
|
name: threescale-cicd
|
|
spec:
|
|
tags:
|
|
- name: latest
|
|
annotations:
|
|
referencePolicy:
|
|
type: Local
|
|
from:
|
|
kind: ImageStreamTag
|
|
name: ${THREESCALE_CICD_VERSION}
|
|
|
|
- name: ${THREESCALE_CICD_VERSION}
|
|
annotations:
|
|
referencePolicy:
|
|
type: Local
|
|
from:
|
|
kind: DockerImage
|
|
name: docker.io/nmasse/threescale-cicd:${THREESCALE_CICD_VERSION}
|
|
|
|
- kind: "BuildConfig"
|
|
apiVersion: "v1"
|
|
metadata:
|
|
name: "deploy-3scale-api-${API_NAME}"
|
|
spec:
|
|
source:
|
|
type: "Git"
|
|
git:
|
|
uri: "${API_GIT_URI}"
|
|
ref: "${API_GIT_REF}"
|
|
contextDir: "${API_GIT_CONTEXT_DIR}"
|
|
strategy:
|
|
type: "Custom"
|
|
customStrategy:
|
|
from:
|
|
kind: "ImageStreamTag"
|
|
name: "threescale-cicd:${THREESCALE_CICD_VERSION}"
|
|
env:
|
|
- name: THREESCALE_CICD_OPENAPI_FILE_FORMAT
|
|
value: ${API_OPENAPI_FILE_FORMAT}
|
|
- name: THREESCALE_CICD_OPENAPI_FILE
|
|
value: ${API_OPENAPI_FILE}
|
|
- name: THREESCALE_CICD_API_BASE_SYSTEM_NAME
|
|
value: ${API_NAME}
|
|
secrets:
|
|
- secretSource:
|
|
name: "3scale-admin-portal-${API_NAME}"
|
|
mountPath: "/tmp/secrets"
|
|
triggers:
|
|
- type: ConfigChange
|
|
|
|
- apiVersion: v1
|
|
kind: Secret
|
|
metadata:
|
|
name: 3scale-admin-portal-${API_NAME}
|
|
type: Opaque
|
|
stringData:
|
|
hostname: ${THREESCALE_ADMIN_PORTAL_HOSTNAME}
|
|
access_token: ${THREESCALE_ADMIN_PORTAL_ACCESS_TOKEN}
|
|
sso_issuer_endpoint: ${SSO_ISSUER_ENDPOINT}
|