Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added new application to redirect requests from GitHub #103

Open
wants to merge 3 commits into
base: v2
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
118 changes: 118 additions & 0 deletions .openshift/templates/smee-webhook.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can this be changed to Dockerfile?

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