Created
August 3, 2018 13:55
-
-
Save lholmquist/f22e006c8f9374a8db8a3202646846a7 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: v1 | |
kind: Template | |
metadata: | |
name: react-web-app | |
annotations: | |
iconClass: icon-jboss | |
tags: nodejs, react, web app | |
template.openshift.io/provider-display-name: "Red Hat, Inc." | |
description: Just building a little react app with a web builder | |
parameters: | |
- name: SOURCE_REPOSITORY_URL | |
description: The source URL for the application | |
displayName: Source URL | |
required: true | |
- name: SOURCE_REPOSITORY_REF | |
description: The branch name for the application | |
displayName: Source Branch | |
value: master | |
required: true | |
- name: SOURCE_REPOSITORY_DIR | |
description: The location within the source repo of the application | |
displayName: Source Directory | |
value: . | |
required: true | |
- name: GITHUB_WEBHOOK_SECRET | |
description: A secret string used to configure the GitHub webhook. | |
displayName: GitHub Webhook Secret | |
required: true | |
from: '[a-zA-Z0-9]{40}' | |
generate: expression | |
objects: | |
- apiVersion: v1 | |
kind: ImageStream | |
metadata: | |
name: react-web-app-builder | |
spec: {} | |
- apiVersion: v1 | |
kind: ImageStream | |
metadata: | |
name: react-web-app-runtime | |
spec: {} | |
- apiVersion: v1 | |
kind: ImageStream | |
metadata: | |
name: web-app-builder-runtime | |
spec: | |
tags: | |
- name: latest | |
from: | |
kind: DockerImage | |
name: bucharestgold/centos7-s2i-web-app:0.0.1 | |
- apiVersion: v1 | |
kind: ImageStream | |
metadata: | |
name: nginx-image-runtime | |
spec: | |
tags: | |
- name: latest | |
from: | |
kind: DockerImage | |
name: 'centos/nginx-112-centos7:latest' | |
- apiVersion: v1 | |
kind: BuildConfig | |
metadata: | |
name: react-web-app-builder | |
spec: | |
output: | |
to: | |
kind: ImageStreamTag | |
name: react-web-app-builder:latest | |
postCommit: {} | |
resources: {} | |
source: | |
git: | |
uri: ${SOURCE_REPOSITORY_URL} | |
ref: ${SOURCE_REPOSITORY_REF} | |
contextDir: ${SOURCE_REPOSITORY_DIR} | |
type: Git | |
strategy: | |
sourceStrategy: | |
from: | |
kind: ImageStreamTag | |
name: web-app-builder-runtime:latest | |
incremental: true | |
type: Source | |
triggers: | |
- github: | |
secret: ${GITHUB_WEBHOOK_SECRET} | |
type: GitHub | |
- type: ConfigChange | |
- imageChange: {} | |
type: ImageChange | |
status: | |
lastVersion: 0 | |
- apiVersion: v1 | |
kind: BuildConfig | |
metadata: | |
name: react-web-app-runtime | |
spec: | |
output: | |
to: | |
kind: ImageStreamTag | |
name: react-web-app-runtime:latest | |
postCommit: {} | |
resources: {} | |
source: | |
type: Image | |
images: | |
- from: | |
kind: ImageStreamTag | |
name: react-web-app-builder:latest | |
paths: | |
- destinationDir: . | |
sourcePath: /usr/share/nginx/html/. | |
strategy: | |
sourceStrategy: | |
from: | |
kind: ImageStreamTag | |
name: nginx-image-runtime:latest | |
incremental: true | |
type: Source | |
triggers: | |
- github: | |
secret: ${GITHUB_WEBHOOK_SECRET} | |
type: GitHub | |
- type: ConfigChange | |
- imageChange: | |
type: ImageChange | |
from: | |
kind: ImageStreamTag | |
name: react-web-app-builder:latest | |
status: | |
lastVersion: 0 | |
- apiVersion: v1 | |
kind: DeploymentConfig | |
metadata: | |
labels: | |
app: react-web-app | |
name: react-web-app | |
spec: | |
replicas: 1 | |
revisionHistoryLimit: 2 | |
selector: | |
app: react-web-app | |
strategy: | |
rollingParams: | |
timeoutSeconds: 3600 | |
type: Rolling | |
template: | |
metadata: | |
labels: | |
app: react-web-app | |
spec: | |
containers: | |
- env: | |
- name: KUBERNETES_NAMESPACE | |
valueFrom: | |
fieldRef: | |
fieldPath: metadata.namespace | |
image: react-web-app-runtime | |
imagePullPolicy: IfNotPresent | |
name: react-web-app-runtime | |
ports: | |
- containerPort: 8080 | |
name: http | |
protocol: TCP | |
metadata: | |
labels: | |
app: react-web-app | |
triggers: | |
- type: ConfigChange | |
- type: ImageChange | |
imageChangeParams: | |
automatic: true | |
containerNames: | |
- react-web-app-runtime | |
from: | |
kind: ImageStreamTag | |
name: 'react-web-app-runtime:latest' | |
- apiVersion: v1 | |
kind: Service | |
metadata: | |
labels: | |
app: react-web-app | |
name: react-web-app | |
spec: | |
ports: | |
- name: http | |
port: 8080 | |
selector: | |
app: react-web-app | |
- apiVersion: v1 | |
kind: Route | |
metadata: | |
labels: | |
app: react-web-app | |
name: frontend | |
spec: | |
port: | |
targetPort: 8080 | |
to: | |
kind: Service | |
name: react-web-app |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment