From 3530063548498d8dbb8f8e5769256c0a5c40830b Mon Sep 17 00:00:00 2001 From: Armando Rivas Date: Tue, 16 Jun 2020 10:42:21 -0500 Subject: [PATCH 1/3] Added template to redirect request from GitHub --- .openshift/templates/smee-template.yml | 117 +++++++++++++++++++++++++ 1 file changed, 117 insertions(+) create mode 100644 .openshift/templates/smee-template.yml diff --git a/.openshift/templates/smee-template.yml b/.openshift/templates/smee-template.yml new file mode 100644 index 00000000..a8fe5876 --- /dev/null +++ b/.openshift/templates/smee-template.yml @@ -0,0 +1,117 @@ +apiVersion: v1 +kind: Template +metadata: + name: smee-webhook + annotations: + iconClass: icon-nodejs + tags: smee + description: Build the Smee Webhook App +labels: + application: ${APPLICATION_NAME} +objects: +- apiVersion: image.openshift.io/v1 + kind: ImageStream + metadata: + labels: + app: ${APPLICATION_NAME} + name: node + spec: + lookupPolicy: + local: false + tags: + - from: + kind: DockerImage + name: node:10 + name: "10" + referencePolicy: + type: Source +- apiVersion: image.openshift.io/v1 + kind: ImageStream + metadata: + labels: + app: ${APPLICATION_NAME} + name: ${APPLICATION_NAME} +- apiVersion: build.openshift.io/v1 + kind: BuildConfig + metadata: + labels: + app: ${APPLICATION_NAME} + name: ${APPLICATION_NAME} + spec: + output: + to: + kind: ImageStreamTag + name: ${APPLICATION_NAME}:latest + runPolicy: Serial + source: + dockerfile: |- + FROM node:latest + RUN npm install --global smee-client + ENTRYPOINT smee -u ${SMEE_URL} -t ${SMEE_TARGET} + type: Binary + strategy: + dockerStrategy: + from: + kind: ImageStreamTag + name: node:10 + type: Docker + triggers: + - type: ConfigChange + - type: ImageChange +- apiVersion: apps.openshift.io/v1 + kind: DeploymentConfig + metadata: + labels: + app: ${APPLICATION_NAME} + name: ${APPLICATION_NAME} + spec: + replicas: 1 + selector: + app: ${APPLICATION_NAME} + deploymentconfig: ${APPLICATION_NAME} + template: + metadata: + labels: + app: ${APPLICATION_NAME} + deploymentconfig: ${APPLICATION_NAME} + spec: + containers: + - env: + - name: NODE_TLS_REJECT_UNAUTHORIZED + value: "0" + image: ${APPLICATION_NAME}:latest + name: ${APPLICATION_NAME} + test: false + triggers: + - type: ConfigChange + - imageChangeParams: + automatic: true + containerNames: + - ${APPLICATION_NAME} + from: + kind: ImageStreamTag + name: ${APPLICATION_NAME}:latest + type: ImageChange + status: + availableReplicas: 0 + latestVersion: 0 + observedGeneration: 0 + readyReplicas: 0 + replicas: 0 + unavailableReplicas: 0 + updatedReplicas: 0 +parameters: + - name: APPLICATION_NAME + description: The name for the application. + required: true + value: smee-webhook + - name: SMEE_URL + description: URL of the webhook proxy service + displayName: Webhook URL + value: https://smee.io/bn7mV7yPnzhkeRd + required: true + - name: SMEE_TARGET + description: Full URL of the target service the events will forward to (Generated git webhook) + displayName: The target + value: https://open.paas.redhat.com/oapi/v1/namespaces/ninja-board-dev/buildconfigs/ninja-board-back-end/webhooks/ninja-backend/github + required: true \ No newline at end of file From fa33fc693234601c9d9654a61e742347754c344e Mon Sep 17 00:00:00 2001 From: Armando Rivas Date: Tue, 16 Jun 2020 10:45:26 -0500 Subject: [PATCH 2/3] Renamed template --- .openshift/templates/{smee-template.yml => smee-webhook.yml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .openshift/templates/{smee-template.yml => smee-webhook.yml} (100%) diff --git a/.openshift/templates/smee-template.yml b/.openshift/templates/smee-webhook.yml similarity index 100% rename from .openshift/templates/smee-template.yml rename to .openshift/templates/smee-webhook.yml From 809a25a590f8108f929b84e499b78bb9f4024296 Mon Sep 17 00:00:00 2001 From: Armando Rivas Date: Tue, 16 Jun 2020 10:47:58 -0500 Subject: [PATCH 3/3] Added newline at the end of the file --- .openshift/templates/smee-webhook.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.openshift/templates/smee-webhook.yml b/.openshift/templates/smee-webhook.yml index a8fe5876..b28dd5cd 100644 --- a/.openshift/templates/smee-webhook.yml +++ b/.openshift/templates/smee-webhook.yml @@ -114,4 +114,5 @@ parameters: description: Full URL of the target service the events will forward to (Generated git webhook) displayName: The target value: https://open.paas.redhat.com/oapi/v1/namespaces/ninja-board-dev/buildconfigs/ninja-board-back-end/webhooks/ninja-backend/github - required: true \ No newline at end of file + required: true +