Merge pull request #7 from rhcarvalho/std-tmpl
Standardize templates across examples
This commit is contained in:
commit
05fd3807b5
1 changed files with 66 additions and 59 deletions
|
@ -4,17 +4,23 @@
|
||||||
"metadata": {
|
"metadata": {
|
||||||
"name": "nodejs-example",
|
"name": "nodejs-example",
|
||||||
"annotations": {
|
"annotations": {
|
||||||
"description": "A simple Node.js application with no database",
|
"description": "An example Node.js application with no database",
|
||||||
"iconClass": "icon-nodejs",
|
"tags": "instant-app,nodejs",
|
||||||
"tags": "instant-app,nodejs"
|
"iconClass": "icon-nodejs"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"labels": {
|
||||||
|
"template": "nodejs-example"
|
||||||
|
},
|
||||||
"objects": [
|
"objects": [
|
||||||
{
|
{
|
||||||
"kind": "Service",
|
"kind": "Service",
|
||||||
"apiVersion": "v1",
|
"apiVersion": "v1",
|
||||||
"metadata": {
|
"metadata": {
|
||||||
"name": "${FRONTEND_SERVICE_NAME}"
|
"name": "nodejs-frontend",
|
||||||
|
"annotations": {
|
||||||
|
"description": "Exposes and load balances the application pods"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"spec": {
|
"spec": {
|
||||||
"ports": [
|
"ports": [
|
||||||
|
@ -25,7 +31,7 @@
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"selector": {
|
"selector": {
|
||||||
"name": "${FRONTEND_SERVICE_NAME}"
|
"name": "nodejs-frontend"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -33,21 +39,24 @@
|
||||||
"kind": "Route",
|
"kind": "Route",
|
||||||
"apiVersion": "v1",
|
"apiVersion": "v1",
|
||||||
"metadata": {
|
"metadata": {
|
||||||
"name": "${FRONTEND_ROUTE}"
|
"name": "nodejs-route"
|
||||||
},
|
},
|
||||||
"spec": {
|
"spec": {
|
||||||
"host" : "${FRONTEND_ROUTE}",
|
"host": "${FRONTEND_ROUTE}",
|
||||||
"to": {
|
"to": {
|
||||||
"kind" : "Service",
|
"kind": "Service",
|
||||||
"name" : "${FRONTEND_SERVICE_NAME}"
|
"name": "nodejs-frontend"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"kind": "ImageStream",
|
"kind": "ImageStream",
|
||||||
"apiVersion": "v1",
|
"apiVersion": "v1",
|
||||||
"metadata": {
|
"metadata": {
|
||||||
"name": "nodejs-example"
|
"name": "nodejs-example",
|
||||||
|
"annotations": {
|
||||||
|
"description": "Keeps track of changes in the application image"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -55,67 +64,59 @@
|
||||||
"apiVersion": "v1",
|
"apiVersion": "v1",
|
||||||
"metadata": {
|
"metadata": {
|
||||||
"name": "nodejs-example",
|
"name": "nodejs-example",
|
||||||
"labels": {
|
"annotations": {
|
||||||
"name": "nodejs-example"
|
"description": "Defines how to build the application"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"spec": {
|
"spec": {
|
||||||
"triggers": [
|
|
||||||
{
|
|
||||||
"type": "GitHub",
|
|
||||||
"github": {
|
|
||||||
"secret": "secret101"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "Generic",
|
|
||||||
"generic": {
|
|
||||||
"secret": "secret101"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "ImageChange"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"source": {
|
"source": {
|
||||||
"type": "Git",
|
"type": "Git",
|
||||||
"git": {
|
"git": {
|
||||||
"uri": "${SOURCE_REPOSITORY_URL}"
|
"uri": "${SOURCE_REPOSITORY_URL}"
|
||||||
}
|
},
|
||||||
|
"contextDir": "${CONTEXT_DIR}"
|
||||||
},
|
},
|
||||||
"strategy": {
|
"strategy": {
|
||||||
"type": "Source",
|
"type": "Source",
|
||||||
"sourceStrategy": {
|
"sourceStrategy": {
|
||||||
"from": {
|
"from": {
|
||||||
"kind": "ImageStreamTag",
|
"kind": "ImageStreamTag",
|
||||||
"name": "nodejs:latest",
|
"namespace": "openshift",
|
||||||
"namespace": "openshift"
|
"name": "nodejs:0.10"
|
||||||
},
|
}
|
||||||
"incremental": true
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"output": {
|
"output": {
|
||||||
"to": {
|
"to": {
|
||||||
"kind": "ImageStreamTag",
|
"kind": "ImageStream",
|
||||||
"name": "nodejs-example:latest"
|
"name": "nodejs-example"
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
|
"triggers": [
|
||||||
|
{
|
||||||
|
"type": "ImageChange"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "GitHub",
|
||||||
|
"github": {
|
||||||
|
"secret": "${GITHUB_WEBHOOK_SECRET}"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"kind": "DeploymentConfig",
|
"kind": "DeploymentConfig",
|
||||||
"apiVersion": "v1",
|
"apiVersion": "v1",
|
||||||
"metadata": {
|
"metadata": {
|
||||||
"name": "nodejs-frontend"
|
"name": "nodejs-frontend",
|
||||||
|
"annotations": {
|
||||||
|
"description": "Defines how to deploy the application server"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"spec": {
|
"spec": {
|
||||||
"strategy": {
|
"strategy": {
|
||||||
"type": "Rolling",
|
"type": "Rolling"
|
||||||
"rollingParams": {
|
|
||||||
"updatePeriodSeconds": 1,
|
|
||||||
"intervalSeconds": 1,
|
|
||||||
"timeoutSeconds": 120
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
"triggers": [
|
"triggers": [
|
||||||
{
|
{
|
||||||
|
@ -126,20 +127,24 @@
|
||||||
"nodejs-example"
|
"nodejs-example"
|
||||||
],
|
],
|
||||||
"from": {
|
"from": {
|
||||||
"kind": "ImageStreamTag",
|
"kind": "ImageStreamTag",
|
||||||
"name": "nodejs-example:latest"
|
"name": "nodejs-example:latest"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "ConfigChange"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"replicas": 1,
|
"replicas": 1,
|
||||||
"selector": {
|
"selector": {
|
||||||
"name": "nodejs-example"
|
"name": "nodejs-frontend"
|
||||||
},
|
},
|
||||||
"template": {
|
"template": {
|
||||||
"metadata": {
|
"metadata": {
|
||||||
|
"name": "nodejs-frontend",
|
||||||
"labels": {
|
"labels": {
|
||||||
"name": "nodejs-example"
|
"name": "nodejs-frontend"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"spec": {
|
"spec": {
|
||||||
|
@ -162,21 +167,23 @@
|
||||||
"parameters": [
|
"parameters": [
|
||||||
{
|
{
|
||||||
"name": "SOURCE_REPOSITORY_URL",
|
"name": "SOURCE_REPOSITORY_URL",
|
||||||
"description": "The URL with your Node.js application source code",
|
"description": "The URL of the repository with your application source code",
|
||||||
"value": "https://github.com/openshift/nodejs-ex.git"
|
"value": "https://github.com/openshift/nodejs-ex.git"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "FRONTEND_SERVICE_NAME",
|
"name": "CONTEXT_DIR",
|
||||||
"description": "Frontend service name",
|
"description": "Set this to the relative path to your project if it is not in the root of your repository"
|
||||||
"value": "nodejs"
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "FRONTEND_ROUTE",
|
"name": "FRONTEND_ROUTE",
|
||||||
"description": "The exposed hostname that will route to the Node.js service",
|
"description": "The exposed hostname that will route to the Node.js service",
|
||||||
"value": "nodejs.apps"
|
"value": "nodejs.app"
|
||||||
}
|
},
|
||||||
],
|
{
|
||||||
"labels": {
|
"name": "GITHUB_WEBHOOK_SECRET",
|
||||||
"template": "nodejs-example"
|
"description": "A secret string used to configure the GitHub webhook",
|
||||||
}
|
"generate": "expression",
|
||||||
|
"from": "[a-zA-Z0-9]{40}"
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue