{
	"kind": "Template",
	"apiVersion": "v1",
	"metadata": {
		"name": "react-web-app-example",
		"creationTimestamp": null,
		"annotations": {
			"description": "Build a basic React Web Application",
			"iconClass": "icon-js",
			"openshift.io/display-name": "React Web Application",
			"tags": "nodejs, react, web app",
			"template.openshift.io/provider-display-name": "Red Hat, Inc."
		}
	},
	"message": "The following service(s) have been created in your project: ${NAME}.\n\nMore message text here",
	"objects": [
		{
			"apiVersion": "v1",
			"kind": "ImageStream",
			"metadata": {
				"labels": {
					"app": "${NAME}"
				},
				"name": "${NAME}"
			},
			"spec": {}
		},
		{
			"apiVersion": "v1",
			"kind": "BuildConfig",
			"metadata": {
				"labels": {
					"app": "${NAME}"
				},
				"name": "${NAME}"
			},
			"spec": {
				"output": {
					"to": {
						"kind": "ImageStreamTag",
						"name": "${NAME}:latest"
					}
				},
				"postCommit": {},
				"resources": {},
				"source": {
					"git": {
						"ref": "${SOURCE_REPOSITORY_REF}",
						"uri": "${SOURCE_REPOSITORY_URL}"
					},
					"type": "Git"
				},
				"strategy": {
					"sourceStrategy": {
						"env": [
							{
								"name": "OUTPUT_DIR",
								"value": "${OUTPUT_DIR}"
							},
							{
								"name": "YARN_ENABLED",
								"value": "${YARN_ENABLED}"
							}
						],
						"from": {
							"kind": "DockerImage",
							"name": "nodeshift/ubi8-s2i-web-app:10.x"
						}
					},
					"type": "Source"
				},
				"triggers": [
					{
						"github": {
							"secret": "${GITHUB_WEBHOOK_SECRET}"
						},
						"type": "GitHub"
					},
					{
						"type": "ConfigChange"
					},
					{
						"imageChange": {},
						"type": "ImageChange"
					}
				]
			},
			"status": {
				"lastVersion": 0
			}
		},
		{
			"apiVersion": "v1",
			"kind": "DeploymentConfig",
			"metadata": {
				"labels": {
					"app": "${NAME}"
				},
				"name": "${NAME}"
			},
			"spec": {
				"replicas": 1,
				"selector": {
					"app": "${NAME}"
				},
				"template": {
					"metadata": {
						"labels": {
							"app": "${NAME}"
						}
					},
					"spec": {
						"containers": [
							{
								"image": "${NAME}:latest",
								"name": "${NAME}",
								"ports": [
									{
										"containerPort": 8080,
										"name": "http",
										"protocol": "TCP"
									}
								],
								"resources": {
									"limits": {
										"memory": "${MEMORY_LIMIT}"
									}
								},
								"securityContext": {
									"privileged": false
								}
							}
						]
					}
				},
				"triggers": [
					{
						"type": "ConfigChange"
					},
					{
						"imageChangeParams": {
							"automatic": true,
							"containerNames": [
								"${NAME}"
							],
							"from": {
								"kind": "ImageStreamTag",
								"name": "${NAME}:latest"
							}
						},
						"type": "ImageChange"
					}
				]
			}
		},
		{
			"apiVersion": "v1",
			"kind": "Service",
			"metadata": {
				"labels": {
					"app": "${NAME}"
				},
				"name": "${NAME}"
			},
			"spec": {
				"ports": [
					{
						"name": "http",
						"port": 8080
					}
				],
				"selector": {
					"app": "${NAME}"
				}
			}
		},
		{
			"apiVersion": "v1",
			"kind": "Route",
			"metadata": {
				"labels": {
					"app": "${NAME}"
				},
				"name": "${NAME}"
			},
			"spec": {
				"port": {
					"targetPort": 8080
				},
				"to": {
					"kind": "Service",
					"name": "${NAME}"
				}
			}
		}
	],
	"parameters": [
		{
			"name": "NAME",
			"displayName": "Name",
			"description": "The name assigned to all of the frontend objects defined in this template.",
			"value": "react-web-app",
			"required": true
		},
		{
			"name": "NAMESPACE",
			"displayName": "Namespace",
			"description": "The OpenShift Namespace where the ImageStream resides.",
			"value": "openshift",
			"required": true
		},
		{
			"name": "MEMORY_LIMIT",
			"displayName": "Memory Limit",
			"description": "Maximum amount of memory the container can use.",
			"value": "512Mi",
			"required": true
		},
		{
			"name": "SOURCE_REPOSITORY_URL",
			"displayName": "Source URL",
			"description": "The source URL for the application",
			"value": "https://github.com/nodeshift-starters/react-web-app",
			"required": true
		},
		{
			"name": "SOURCE_REPOSITORY_REF",
			"displayName": "Source Branch",
			"description": "The branch name for the application",
			"value": "master",
			"required": true
		},
		{
			"name": "SOURCE_REPOSITORY_DIR",
			"displayName": "Source Directory",
			"description": "The location within the source repo of the application",
			"value": ".",
			"required": true
		},
		{
			"name": "OUTPUT_DIR",
			"displayName": "Output Directory",
			"description": "The location of the compiled static files from your web apps builder",
			"value": "build"
		},
		{
			"name": "YARN_ENABLED",
			"displayName": "Yarn Enabled",
			"description": "A flag to enable the use of the Yarn package manager",
			"value": "true"
		},
		{
			"name": "GITHUB_WEBHOOK_SECRET",
			"displayName": "GitHub Webhook Secret",
			"description": "A secret string used to configure the GitHub webhook.",
			"generate": "expression",
			"from": "[a-zA-Z0-9]{40}",
			"required": true
		}
	]
}