|
4 | 4 | "metadata": { |
5 | 5 | "name": "nodejs-example", |
6 | 6 | "annotations": { |
7 | | - "description": "A simple Node.js application with no database", |
8 | | - "iconClass": "icon-nodejs", |
9 | | - "tags": "instant-app,nodejs" |
| 7 | + "description": "An example Node.js application with no database", |
| 8 | + "tags": "instant-app,nodejs", |
| 9 | + "iconClass": "icon-nodejs" |
10 | 10 | } |
11 | 11 | }, |
| 12 | + "labels": { |
| 13 | + "template": "nodejs-example" |
| 14 | + }, |
12 | 15 | "objects": [ |
13 | 16 | { |
14 | 17 | "kind": "Service", |
15 | 18 | "apiVersion": "v1", |
16 | 19 | "metadata": { |
17 | | - "name": "${FRONTEND_SERVICE_NAME}" |
| 20 | + "name": "nodejs-frontend", |
| 21 | + "annotations": { |
| 22 | + "description": "Exposes and load balances the application pods" |
| 23 | + } |
18 | 24 | }, |
19 | 25 | "spec": { |
20 | 26 | "ports": [ |
|
25 | 31 | } |
26 | 32 | ], |
27 | 33 | "selector": { |
28 | | - "name": "${FRONTEND_SERVICE_NAME}" |
| 34 | + "name": "nodejs-frontend" |
29 | 35 | } |
30 | 36 | } |
31 | 37 | }, |
32 | 38 | { |
33 | 39 | "kind": "Route", |
34 | 40 | "apiVersion": "v1", |
35 | 41 | "metadata": { |
36 | | - "name": "${FRONTEND_ROUTE}" |
| 42 | + "name": "nodejs-route" |
37 | 43 | }, |
38 | 44 | "spec": { |
39 | | - "host" : "${FRONTEND_ROUTE}", |
40 | | - "to": { |
41 | | - "kind" : "Service", |
42 | | - "name" : "${FRONTEND_SERVICE_NAME}" |
43 | | - } |
| 45 | + "host": "${FRONTEND_ROUTE}", |
| 46 | + "to": { |
| 47 | + "kind": "Service", |
| 48 | + "name": "nodejs-frontend" |
| 49 | + } |
44 | 50 | } |
45 | 51 | }, |
46 | 52 | { |
47 | 53 | "kind": "ImageStream", |
48 | 54 | "apiVersion": "v1", |
49 | 55 | "metadata": { |
50 | | - "name": "nodejs-example" |
| 56 | + "name": "nodejs-example", |
| 57 | + "annotations": { |
| 58 | + "description": "Keeps track of changes in the application image" |
| 59 | + } |
51 | 60 | } |
52 | 61 | }, |
53 | 62 | { |
54 | 63 | "kind": "BuildConfig", |
55 | 64 | "apiVersion": "v1", |
56 | 65 | "metadata": { |
57 | 66 | "name": "nodejs-example", |
58 | | - "labels": { |
59 | | - "name": "nodejs-example" |
| 67 | + "annotations": { |
| 68 | + "description": "Defines how to build the application" |
60 | 69 | } |
61 | 70 | }, |
62 | 71 | "spec": { |
63 | | - "triggers": [ |
64 | | - { |
65 | | - "type": "GitHub", |
66 | | - "github": { |
67 | | - "secret": "secret101" |
68 | | - } |
69 | | - }, |
70 | | - { |
71 | | - "type": "Generic", |
72 | | - "generic": { |
73 | | - "secret": "secret101" |
74 | | - } |
75 | | - }, |
76 | | - { |
77 | | - "type": "ImageChange" |
78 | | - } |
79 | | - ], |
80 | 72 | "source": { |
81 | 73 | "type": "Git", |
82 | 74 | "git": { |
83 | 75 | "uri": "${SOURCE_REPOSITORY_URL}" |
84 | | - } |
| 76 | + }, |
| 77 | + "contextDir": "${CONTEXT_DIR}" |
85 | 78 | }, |
86 | 79 | "strategy": { |
87 | 80 | "type": "Source", |
88 | 81 | "sourceStrategy": { |
89 | 82 | "from": { |
90 | 83 | "kind": "ImageStreamTag", |
91 | | - "name": "nodejs:latest", |
92 | | - "namespace": "openshift" |
93 | | - }, |
94 | | - "incremental": true |
| 84 | + "namespace": "openshift", |
| 85 | + "name": "nodejs:0.10" |
| 86 | + } |
95 | 87 | } |
96 | 88 | }, |
97 | 89 | "output": { |
98 | 90 | "to": { |
99 | | - "kind": "ImageStreamTag", |
100 | | - "name": "nodejs-example:latest" |
| 91 | + "kind": "ImageStream", |
| 92 | + "name": "nodejs-example" |
101 | 93 | } |
102 | | - } |
| 94 | + }, |
| 95 | + "triggers": [ |
| 96 | + { |
| 97 | + "type": "ImageChange" |
| 98 | + }, |
| 99 | + { |
| 100 | + "type": "GitHub", |
| 101 | + "github": { |
| 102 | + "secret": "${GITHUB_WEBHOOK_SECRET}" |
| 103 | + } |
| 104 | + } |
| 105 | + ] |
103 | 106 | } |
104 | 107 | }, |
105 | 108 | { |
106 | 109 | "kind": "DeploymentConfig", |
107 | 110 | "apiVersion": "v1", |
108 | 111 | "metadata": { |
109 | | - "name": "nodejs-frontend" |
| 112 | + "name": "nodejs-frontend", |
| 113 | + "annotations": { |
| 114 | + "description": "Defines how to deploy the application server" |
| 115 | + } |
110 | 116 | }, |
111 | 117 | "spec": { |
112 | 118 | "strategy": { |
113 | | - "type": "Rolling", |
114 | | - "rollingParams": { |
115 | | - "updatePeriodSeconds": 1, |
116 | | - "intervalSeconds": 1, |
117 | | - "timeoutSeconds": 120 |
118 | | - } |
| 119 | + "type": "Rolling" |
119 | 120 | }, |
120 | 121 | "triggers": [ |
121 | 122 | { |
|
126 | 127 | "nodejs-example" |
127 | 128 | ], |
128 | 129 | "from": { |
129 | | - "kind": "ImageStreamTag", |
| 130 | + "kind": "ImageStreamTag", |
130 | 131 | "name": "nodejs-example:latest" |
131 | 132 | } |
132 | 133 | } |
| 134 | + }, |
| 135 | + { |
| 136 | + "type": "ConfigChange" |
133 | 137 | } |
134 | 138 | ], |
135 | 139 | "replicas": 1, |
136 | 140 | "selector": { |
137 | | - "name": "nodejs-example" |
| 141 | + "name": "nodejs-frontend" |
138 | 142 | }, |
139 | 143 | "template": { |
140 | 144 | "metadata": { |
| 145 | + "name": "nodejs-frontend", |
141 | 146 | "labels": { |
142 | | - "name": "nodejs-example" |
| 147 | + "name": "nodejs-frontend" |
143 | 148 | } |
144 | 149 | }, |
145 | 150 | "spec": { |
|
162 | 167 | "parameters": [ |
163 | 168 | { |
164 | 169 | "name": "SOURCE_REPOSITORY_URL", |
165 | | - "description": "The URL with your Node.js application source code", |
| 170 | + "description": "The URL of the repository with your application source code", |
166 | 171 | "value": "https://github.com/openshift/nodejs-ex.git" |
167 | 172 | }, |
168 | 173 | { |
169 | | - "name": "FRONTEND_SERVICE_NAME", |
170 | | - "description": "Frontend service name", |
171 | | - "value": "nodejs" |
| 174 | + "name": "CONTEXT_DIR", |
| 175 | + "description": "Set this to the relative path to your project if it is not in the root of your repository" |
172 | 176 | }, |
173 | 177 | { |
174 | 178 | "name": "FRONTEND_ROUTE", |
175 | 179 | "description": "The exposed hostname that will route to the Node.js service", |
176 | | - "value": "nodejs.apps" |
177 | | - } |
178 | | - ], |
179 | | - "labels": { |
180 | | - "template": "nodejs-example" |
181 | | - } |
| 180 | + "value": "nodejs.app" |
| 181 | + }, |
| 182 | + { |
| 183 | + "name": "GITHUB_WEBHOOK_SECRET", |
| 184 | + "description": "A secret string used to configure the GitHub webhook", |
| 185 | + "generate": "expression", |
| 186 | + "from": "[a-zA-Z0-9]{40}" |
| 187 | + } |
| 188 | + ] |
182 | 189 | } |
0 commit comments