... | ... |
@@ -427,6 +427,11 @@ correct version in your GOPATH and then run `godep save <pkgname>`. This should |
427 | 427 |
version of `Godeps/Godeps.json`, and update `Godeps/_workspace/src`. Create a commit that includes |
428 | 428 |
both of these changes with message `bump(<pkgname>): <pkgcommit>`. |
429 | 429 |
|
430 |
+## Updating external examples |
|
431 |
+ |
|
432 |
+`hack/update-external-example.sh` will pull down example files from external repositories and deposit them under the `examples` directory. |
|
433 |
+Run this script if you need to refresh an example file, or add a new one. See the script and `examples/quickstarts/README.md` for more details. |
|
434 |
+ |
|
430 | 435 |
## Troubleshooting |
431 | 436 |
|
432 | 437 |
If you run into difficulties running OpenShift, start by reading through the |
... | ... |
@@ -12,6 +12,7 @@ available on top of Kubernetes and Docker. |
12 | 12 |
* [Project Quotas and Resource Limits](./project-quota) demonstrates how quota and resource limits can be applied to resources in an OpenShift project. |
13 | 13 |
* [Replicated Zookeper Template](./zookeeper) provides a template for an OpenShift service that exposes a simple set of primitives that distributed applications can build upon to implement higher level services for synchronization, configuration maintenance, and groups and naming. |
14 | 14 |
* [Storage Examples](./storage-examples) provides a high level tutorial and templates for local and persistent storage on OpenShift using simple nginx applications. |
15 |
-* [Database Templates](./db-templates) provide templates for ephemeral and persistent storage on OpenShift using MongoDB, MySQL, and PostgreSQL. |
|
16 | 15 |
* [Clustered Etcd Template](./etcd) provides a template for setting up a clustered instance of the [Etcd](https://github.com/coreos/etcd) key-value store as a service on OpenShift. |
17 |
-* [Configurable Git Server](./gitserver) sets up a serivce capable of automatic mirroring of Git repositories, intended for use within a container or Kubernetes pod. |
|
16 |
+* [Configurable Git Server](./gitserver) sets up a service capable of automatic mirroring of Git repositories, intended for use within a container or Kubernetes pod. |
|
17 |
+* [QuickStarts](./quickstarts) provides templates for very basic applications using various frameworks and databases. |
|
18 |
+* [Database Templates](./db-templates) provides templates for ephemeral and persistent storage on OpenShift using MongoDB, MySQL, and PostgreSQL. |
18 | 19 |
new file mode 100644 |
... | ... |
@@ -0,0 +1,14 @@ |
0 |
+QuickStarts |
|
1 |
+=========== |
|
2 |
+ |
|
3 |
+QuickStarts provide the basic skeleton of an application. Generally they reference a repository containing very simple source code that implements a trivial application using a particular framework. In addition they define any components needed for the application including a Build configuration, supporting services such as Databases, etc. |
|
4 |
+ |
|
5 |
+You can instantiate these templates as is, or fork the source repository they reference and supply your forked repository as the source-repository when instantiating them. |
|
6 |
+ |
|
7 |
+* [CakePHP](https://raw.githubusercontent.com/openshift/cakephp-ex/master/openshift/templates/cakephp-mysql.json) - Provides a basic CakePHP application with a MySQL database. For more information see the [source repository](https://github.com/openshift/cakephp-ex). |
|
8 |
+* [Dancer](https://raw.githubusercontent.com/openshift/dancer-ex/master/openshift/templates/dancer-mysql.json) - Provides a basic Dancer(Perl) application with a MySQL database. For more information see the [source repository](https://github.com/openshift/dancer-ex). |
|
9 |
+* [Django](https://raw.githubusercontent.com/openshift/django-ex/master/openshift/templates/django-postgresql.json) - Provides a basic Django(Python) application with a PostgreSQL database. For more information see the [source repository](https://github.com/openshift/django-ex). |
|
10 |
+* [NodeJS](https://raw.githubusercontent.com/openshift/nodejs-ex/master/openshift/templates/nodejs-mongodb.json) - Provides a basic NodeJS application with a MongoDB database. For more information see the [source repository](https://github.com/openshift/nodejs-ex). |
|
11 |
+* [Rails](https://raw.githubusercontent.com/openshift/rails-ex/master/openshift/templates/rails-postgresql.json) - Provides a basic Rails(Ruby) application with a PostgreSQL database. For more information see the [source repository](https://github.com/openshift/rails-ex). |
|
12 |
+ |
|
13 |
+Note: This file is processed by hack/update-external-examples.sh. New examples must follow the exact syntax of the existing entries. Files in this directory are automatically pulled down, do not add additional files directly to this directory. |
|
0 | 14 |
\ No newline at end of file |
1 | 15 |
new file mode 100644 |
... | ... |
@@ -0,0 +1,390 @@ |
0 |
+{ |
|
1 |
+ "kind": "Template", |
|
2 |
+ "apiVersion": "v1", |
|
3 |
+ "metadata": { |
|
4 |
+ "name": "cakephp-mysql-example", |
|
5 |
+ "annotations": { |
|
6 |
+ "description": "An example CakePHP application with a MySQL database", |
|
7 |
+ "tags": "instant-app,php,cakephp,mysql", |
|
8 |
+ "iconClass": "icon-php" |
|
9 |
+ } |
|
10 |
+ }, |
|
11 |
+ "labels": { |
|
12 |
+ "template": "cakephp-mysql-example" |
|
13 |
+ }, |
|
14 |
+ "objects": [ |
|
15 |
+ { |
|
16 |
+ "kind": "Service", |
|
17 |
+ "apiVersion": "v1", |
|
18 |
+ "metadata": { |
|
19 |
+ "name": "cakephp-mysql-example", |
|
20 |
+ "annotations": { |
|
21 |
+ "description": "Exposes and load balances the application pods" |
|
22 |
+ } |
|
23 |
+ }, |
|
24 |
+ "spec": { |
|
25 |
+ "ports": [ |
|
26 |
+ { |
|
27 |
+ "name": "web", |
|
28 |
+ "port": 8080, |
|
29 |
+ "targetPort": 8080 |
|
30 |
+ } |
|
31 |
+ ], |
|
32 |
+ "selector": { |
|
33 |
+ "name": "cakephp-mysql-example" |
|
34 |
+ } |
|
35 |
+ } |
|
36 |
+ }, |
|
37 |
+ { |
|
38 |
+ "kind": "Route", |
|
39 |
+ "apiVersion": "v1", |
|
40 |
+ "metadata": { |
|
41 |
+ "name": "cakephp-mysql-example" |
|
42 |
+ }, |
|
43 |
+ "spec": { |
|
44 |
+ "host": "${APPLICATION_DOMAIN}", |
|
45 |
+ "to": { |
|
46 |
+ "kind": "Service", |
|
47 |
+ "name": "cakephp-mysql-example" |
|
48 |
+ } |
|
49 |
+ } |
|
50 |
+ }, |
|
51 |
+ { |
|
52 |
+ "kind": "ImageStream", |
|
53 |
+ "apiVersion": "v1", |
|
54 |
+ "metadata": { |
|
55 |
+ "name": "cakephp-mysql-example", |
|
56 |
+ "annotations": { |
|
57 |
+ "description": "Keeps track of changes in the application image" |
|
58 |
+ } |
|
59 |
+ } |
|
60 |
+ }, |
|
61 |
+ { |
|
62 |
+ "kind": "BuildConfig", |
|
63 |
+ "apiVersion": "v1", |
|
64 |
+ "metadata": { |
|
65 |
+ "name": "cakephp-mysql-example", |
|
66 |
+ "annotations": { |
|
67 |
+ "description": "Defines how to build the application" |
|
68 |
+ } |
|
69 |
+ }, |
|
70 |
+ "spec": { |
|
71 |
+ "source": { |
|
72 |
+ "type": "Git", |
|
73 |
+ "git": { |
|
74 |
+ "uri": "${SOURCE_REPOSITORY_URL}", |
|
75 |
+ "ref": "${SOURCE_REPOSITORY_REF}" |
|
76 |
+ }, |
|
77 |
+ "contextDir": "${CONTEXT_DIR}" |
|
78 |
+ }, |
|
79 |
+ "strategy": { |
|
80 |
+ "type": "Source", |
|
81 |
+ "sourceStrategy": { |
|
82 |
+ "from": { |
|
83 |
+ "kind": "ImageStreamTag", |
|
84 |
+ "namespace": "openshift", |
|
85 |
+ "name": "php:5.6" |
|
86 |
+ } |
|
87 |
+ } |
|
88 |
+ }, |
|
89 |
+ "output": { |
|
90 |
+ "to": { |
|
91 |
+ "kind": "ImageStreamTag", |
|
92 |
+ "name": "cakephp-mysql-example:latest" |
|
93 |
+ } |
|
94 |
+ }, |
|
95 |
+ "triggers": [ |
|
96 |
+ { |
|
97 |
+ "type": "ImageChange" |
|
98 |
+ }, |
|
99 |
+ { |
|
100 |
+ "type": "ConfigChange" |
|
101 |
+ }, |
|
102 |
+ { |
|
103 |
+ "type": "GitHub", |
|
104 |
+ "github": { |
|
105 |
+ "secret": "${GITHUB_WEBHOOK_SECRET}" |
|
106 |
+ } |
|
107 |
+ } |
|
108 |
+ ] |
|
109 |
+ } |
|
110 |
+ }, |
|
111 |
+ { |
|
112 |
+ "kind": "DeploymentConfig", |
|
113 |
+ "apiVersion": "v1", |
|
114 |
+ "metadata": { |
|
115 |
+ "name": "cakephp-mysql-example", |
|
116 |
+ "annotations": { |
|
117 |
+ "description": "Defines how to deploy the application server" |
|
118 |
+ } |
|
119 |
+ }, |
|
120 |
+ "spec": { |
|
121 |
+ "strategy": { |
|
122 |
+ "type": "Rolling", |
|
123 |
+ "recreateParams": { |
|
124 |
+ "pre": { |
|
125 |
+ "failurePolicy": "Abort", |
|
126 |
+ "execNewPod": { |
|
127 |
+ "command": [ |
|
128 |
+ "./migrate-database.sh" |
|
129 |
+ ], |
|
130 |
+ "containerName": "cakephp-mysql-example" |
|
131 |
+ } |
|
132 |
+ } |
|
133 |
+ } |
|
134 |
+ }, |
|
135 |
+ "triggers": [ |
|
136 |
+ { |
|
137 |
+ "type": "ImageChange", |
|
138 |
+ "imageChangeParams": { |
|
139 |
+ "automatic": true, |
|
140 |
+ "containerNames": [ |
|
141 |
+ "cakephp-mysql-example" |
|
142 |
+ ], |
|
143 |
+ "from": { |
|
144 |
+ "kind": "ImageStreamTag", |
|
145 |
+ "name": "cakephp-mysql-example:latest" |
|
146 |
+ } |
|
147 |
+ } |
|
148 |
+ }, |
|
149 |
+ { |
|
150 |
+ "type": "ConfigChange" |
|
151 |
+ } |
|
152 |
+ ], |
|
153 |
+ "replicas": 1, |
|
154 |
+ "selector": { |
|
155 |
+ "name": "cakephp-mysql-example" |
|
156 |
+ }, |
|
157 |
+ "template": { |
|
158 |
+ "metadata": { |
|
159 |
+ "name": "cakephp-mysql-example", |
|
160 |
+ "labels": { |
|
161 |
+ "name": "cakephp-mysql-example" |
|
162 |
+ } |
|
163 |
+ }, |
|
164 |
+ "spec": { |
|
165 |
+ "containers": [ |
|
166 |
+ { |
|
167 |
+ "name": "cakephp-mysql-example", |
|
168 |
+ "image": "cakephp-mysql-example", |
|
169 |
+ "ports": [ |
|
170 |
+ { |
|
171 |
+ "containerPort": 8080 |
|
172 |
+ } |
|
173 |
+ ], |
|
174 |
+ "env": [ |
|
175 |
+ { |
|
176 |
+ "name": "DATABASE_SERVICE_NAME", |
|
177 |
+ "value": "${DATABASE_SERVICE_NAME}" |
|
178 |
+ }, |
|
179 |
+ { |
|
180 |
+ "name": "DATABASE_ENGINE", |
|
181 |
+ "value": "${DATABASE_ENGINE}" |
|
182 |
+ }, |
|
183 |
+ { |
|
184 |
+ "name": "DATABASE_NAME", |
|
185 |
+ "value": "${DATABASE_NAME}" |
|
186 |
+ }, |
|
187 |
+ { |
|
188 |
+ "name": "DATABASE_USER", |
|
189 |
+ "value": "${DATABASE_USER}" |
|
190 |
+ }, |
|
191 |
+ { |
|
192 |
+ "name": "DATABASE_PASSWORD", |
|
193 |
+ "value": "${DATABASE_PASSWORD}" |
|
194 |
+ }, |
|
195 |
+ { |
|
196 |
+ "name": "CAKEPHP_SECRET_TOKEN", |
|
197 |
+ "value": "${CAKEPHP_SECRET_TOKEN}" |
|
198 |
+ }, |
|
199 |
+ { |
|
200 |
+ "name": "CAKEPHP_SECURITY_SALT", |
|
201 |
+ "value": "${CAKEPHP_SECURITY_SALT}" |
|
202 |
+ }, |
|
203 |
+ { |
|
204 |
+ "name": "CAKEPHP_SECURITY_CIPHER_SEED", |
|
205 |
+ "value": "${CAKEPHP_SECURITY_CIPHER_SEED}" |
|
206 |
+ }, |
|
207 |
+ { |
|
208 |
+ "name": "OPCACHE_REVALIDATE_FREQ", |
|
209 |
+ "value": "${OPCACHE_REVALIDATE_FREQ}" |
|
210 |
+ } |
|
211 |
+ ] |
|
212 |
+ } |
|
213 |
+ ] |
|
214 |
+ } |
|
215 |
+ } |
|
216 |
+ } |
|
217 |
+ }, |
|
218 |
+ { |
|
219 |
+ "kind": "Service", |
|
220 |
+ "apiVersion": "v1", |
|
221 |
+ "metadata": { |
|
222 |
+ "name": "${DATABASE_SERVICE_NAME}", |
|
223 |
+ "annotations": { |
|
224 |
+ "description": "Exposes the database server" |
|
225 |
+ } |
|
226 |
+ }, |
|
227 |
+ "spec": { |
|
228 |
+ "ports": [ |
|
229 |
+ { |
|
230 |
+ "name": "mysql", |
|
231 |
+ "port": 3306, |
|
232 |
+ "targetPort": 3306 |
|
233 |
+ } |
|
234 |
+ ], |
|
235 |
+ "selector": { |
|
236 |
+ "name": "${DATABASE_SERVICE_NAME}" |
|
237 |
+ } |
|
238 |
+ } |
|
239 |
+ }, |
|
240 |
+ { |
|
241 |
+ "kind": "DeploymentConfig", |
|
242 |
+ "apiVersion": "v1", |
|
243 |
+ "metadata": { |
|
244 |
+ "name": "${DATABASE_SERVICE_NAME}", |
|
245 |
+ "annotations": { |
|
246 |
+ "description": "Defines how to deploy the database" |
|
247 |
+ } |
|
248 |
+ }, |
|
249 |
+ "spec": { |
|
250 |
+ "strategy": { |
|
251 |
+ "type": "Recreate" |
|
252 |
+ }, |
|
253 |
+ "triggers": [ |
|
254 |
+ { |
|
255 |
+ "type": "ImageChange", |
|
256 |
+ "imageChangeParams": { |
|
257 |
+ "automatic": false, |
|
258 |
+ "containerNames": [ |
|
259 |
+ "mysql" |
|
260 |
+ ], |
|
261 |
+ "from": { |
|
262 |
+ "kind": "ImageStreamTag", |
|
263 |
+ "namespace": "openshift", |
|
264 |
+ "name": "mysql:5.6" |
|
265 |
+ } |
|
266 |
+ } |
|
267 |
+ }, |
|
268 |
+ { |
|
269 |
+ "type": "ConfigChange" |
|
270 |
+ } |
|
271 |
+ ], |
|
272 |
+ "replicas": 1, |
|
273 |
+ "selector": { |
|
274 |
+ "name": "${DATABASE_SERVICE_NAME}" |
|
275 |
+ }, |
|
276 |
+ "template": { |
|
277 |
+ "metadata": { |
|
278 |
+ "name": "${DATABASE_SERVICE_NAME}", |
|
279 |
+ "labels": { |
|
280 |
+ "name": "${DATABASE_SERVICE_NAME}" |
|
281 |
+ } |
|
282 |
+ }, |
|
283 |
+ "spec": { |
|
284 |
+ "containers": [ |
|
285 |
+ { |
|
286 |
+ "name": "mysql", |
|
287 |
+ "image": "mysql", |
|
288 |
+ "ports": [ |
|
289 |
+ { |
|
290 |
+ "containerPort": 3306 |
|
291 |
+ } |
|
292 |
+ ], |
|
293 |
+ "env": [ |
|
294 |
+ { |
|
295 |
+ "name": "MYSQL_USER", |
|
296 |
+ "value": "${DATABASE_USER}" |
|
297 |
+ }, |
|
298 |
+ { |
|
299 |
+ "name": "MYSQL_PASSWORD", |
|
300 |
+ "value": "${DATABASE_PASSWORD}" |
|
301 |
+ }, |
|
302 |
+ { |
|
303 |
+ "name": "MYSQL_DATABASE", |
|
304 |
+ "value": "${DATABASE_NAME}" |
|
305 |
+ } |
|
306 |
+ ] |
|
307 |
+ } |
|
308 |
+ ] |
|
309 |
+ } |
|
310 |
+ } |
|
311 |
+ } |
|
312 |
+ } |
|
313 |
+ ], |
|
314 |
+ "parameters": [ |
|
315 |
+ { |
|
316 |
+ "name": "SOURCE_REPOSITORY_URL", |
|
317 |
+ "description": "The URL of the repository with your application source code", |
|
318 |
+ "value": "https://github.com/openshift/cakephp-ex.git" |
|
319 |
+ }, |
|
320 |
+ { |
|
321 |
+ "name": "SOURCE_REPOSITORY_REF", |
|
322 |
+ "description": "Set this to a branch name, tag or other ref of your repository if you are not using the default branch" |
|
323 |
+ }, |
|
324 |
+ { |
|
325 |
+ "name": "CONTEXT_DIR", |
|
326 |
+ "description": "Set this to the relative path to your project if it is not in the root of your repository" |
|
327 |
+ }, |
|
328 |
+ { |
|
329 |
+ "name": "APPLICATION_DOMAIN", |
|
330 |
+ "description": "The exposed hostname that will route to the CakePHP service, if left blank a value will be defaulted.", |
|
331 |
+ "value": "" |
|
332 |
+ }, |
|
333 |
+ { |
|
334 |
+ "name": "GITHUB_WEBHOOK_SECRET", |
|
335 |
+ "description": "A secret string used to configure the GitHub webhook", |
|
336 |
+ "generate": "expression", |
|
337 |
+ "from": "[a-zA-Z0-9]{40}" |
|
338 |
+ }, |
|
339 |
+ { |
|
340 |
+ "name": "DATABASE_SERVICE_NAME", |
|
341 |
+ "description": "Database service name", |
|
342 |
+ "value": "mysql" |
|
343 |
+ }, |
|
344 |
+ { |
|
345 |
+ "name": "DATABASE_ENGINE", |
|
346 |
+ "description": "Database engine: postgresql, mysql or sqlite (default)", |
|
347 |
+ "value": "mysql" |
|
348 |
+ }, |
|
349 |
+ { |
|
350 |
+ "name": "DATABASE_NAME", |
|
351 |
+ "description": "Database name", |
|
352 |
+ "value": "default" |
|
353 |
+ }, |
|
354 |
+ { |
|
355 |
+ "name": "DATABASE_USER", |
|
356 |
+ "description": "Database user name", |
|
357 |
+ "value": "cakephp" |
|
358 |
+ }, |
|
359 |
+ { |
|
360 |
+ "name": "DATABASE_PASSWORD", |
|
361 |
+ "description": "Database user password", |
|
362 |
+ "generate": "expression", |
|
363 |
+ "from": "[a-zA-Z0-9]{16}" |
|
364 |
+ }, |
|
365 |
+ { |
|
366 |
+ "name": "CAKEPHP_SECRET_TOKEN", |
|
367 |
+ "description": "Set this to a long random string", |
|
368 |
+ "generate": "expression", |
|
369 |
+ "from": "[\\w]{50}" |
|
370 |
+ }, |
|
371 |
+ { |
|
372 |
+ "name": "CAKEPHP_SECURITY_SALT", |
|
373 |
+ "description": "Security salt for session hash", |
|
374 |
+ "generate": "expression", |
|
375 |
+ "from": "[a-zA-Z0-9]{40}" |
|
376 |
+ }, |
|
377 |
+ { |
|
378 |
+ "name": "CAKEPHP_SECURITY_CIPHER_SEED", |
|
379 |
+ "description": "Security cipher seed for session hash", |
|
380 |
+ "generate": "expression", |
|
381 |
+ "from": "[0-9]{30}" |
|
382 |
+ }, |
|
383 |
+ { |
|
384 |
+ "name": "OPCACHE_REVALIDATE_FREQ", |
|
385 |
+ "description": "The How often to check script timestamps for updates, in seconds. 0 will result in OPcache checking for updates on every request.", |
|
386 |
+ "value": "2" |
|
387 |
+ } |
|
388 |
+ ] |
|
389 |
+} |
0 | 390 |
new file mode 100644 |
... | ... |
@@ -0,0 +1,360 @@ |
0 |
+{ |
|
1 |
+ "kind": "Template", |
|
2 |
+ "apiVersion": "v1", |
|
3 |
+ "metadata": { |
|
4 |
+ "name": "dancer-mysql-example", |
|
5 |
+ "annotations": { |
|
6 |
+ "description": "An example Dancer application with a MySQL database", |
|
7 |
+ "tags": "instant-app,perl,dancer,mysql", |
|
8 |
+ "iconClass": "icon-perl" |
|
9 |
+ } |
|
10 |
+ }, |
|
11 |
+ "labels": { |
|
12 |
+ "template": "dancer-mysql-example" |
|
13 |
+ }, |
|
14 |
+ "objects": [ |
|
15 |
+ { |
|
16 |
+ "kind": "Service", |
|
17 |
+ "apiVersion": "v1", |
|
18 |
+ "metadata": { |
|
19 |
+ "name": "dancer-mysql-example", |
|
20 |
+ "annotations": { |
|
21 |
+ "description": "Exposes and load balances the application pods" |
|
22 |
+ } |
|
23 |
+ }, |
|
24 |
+ "spec": { |
|
25 |
+ "ports": [ |
|
26 |
+ { |
|
27 |
+ "name": "web", |
|
28 |
+ "port": 8080, |
|
29 |
+ "targetPort": 8080 |
|
30 |
+ } |
|
31 |
+ ], |
|
32 |
+ "selector": { |
|
33 |
+ "name": "dancer-mysql-example" |
|
34 |
+ } |
|
35 |
+ } |
|
36 |
+ }, |
|
37 |
+ { |
|
38 |
+ "kind": "Route", |
|
39 |
+ "apiVersion": "v1", |
|
40 |
+ "metadata": { |
|
41 |
+ "name": "dancer-mysql-example" |
|
42 |
+ }, |
|
43 |
+ "spec": { |
|
44 |
+ "host": "${APPLICATION_DOMAIN}", |
|
45 |
+ "to": { |
|
46 |
+ "kind": "Service", |
|
47 |
+ "name": "dancer-mysql-example" |
|
48 |
+ } |
|
49 |
+ } |
|
50 |
+ }, |
|
51 |
+ { |
|
52 |
+ "kind": "ImageStream", |
|
53 |
+ "apiVersion": "v1", |
|
54 |
+ "metadata": { |
|
55 |
+ "name": "dancer-mysql-example", |
|
56 |
+ "annotations": { |
|
57 |
+ "description": "Keeps track of changes in the application image" |
|
58 |
+ } |
|
59 |
+ } |
|
60 |
+ }, |
|
61 |
+ { |
|
62 |
+ "kind": "BuildConfig", |
|
63 |
+ "apiVersion": "v1", |
|
64 |
+ "metadata": { |
|
65 |
+ "name": "dancer-mysql-example", |
|
66 |
+ "annotations": { |
|
67 |
+ "description": "Defines how to build the application" |
|
68 |
+ } |
|
69 |
+ }, |
|
70 |
+ "spec": { |
|
71 |
+ "source": { |
|
72 |
+ "type": "Git", |
|
73 |
+ "git": { |
|
74 |
+ "uri": "${SOURCE_REPOSITORY_URL}", |
|
75 |
+ "ref": "${SOURCE_REPOSITORY_REF}" |
|
76 |
+ }, |
|
77 |
+ "contextDir": "${CONTEXT_DIR}" |
|
78 |
+ }, |
|
79 |
+ "strategy": { |
|
80 |
+ "type": "Source", |
|
81 |
+ "sourceStrategy": { |
|
82 |
+ "from": { |
|
83 |
+ "kind": "ImageStreamTag", |
|
84 |
+ "namespace": "openshift", |
|
85 |
+ "name": "perl:5.20" |
|
86 |
+ } |
|
87 |
+ } |
|
88 |
+ }, |
|
89 |
+ "output": { |
|
90 |
+ "to": { |
|
91 |
+ "kind": "ImageStreamTag", |
|
92 |
+ "name": "dancer-mysql-example:latest" |
|
93 |
+ } |
|
94 |
+ }, |
|
95 |
+ "triggers": [ |
|
96 |
+ { |
|
97 |
+ "type": "ImageChange" |
|
98 |
+ }, |
|
99 |
+ { |
|
100 |
+ "type": "ConfigChange" |
|
101 |
+ }, |
|
102 |
+ { |
|
103 |
+ "type": "GitHub", |
|
104 |
+ "github": { |
|
105 |
+ "secret": "${GITHUB_WEBHOOK_SECRET}" |
|
106 |
+ } |
|
107 |
+ } |
|
108 |
+ ] |
|
109 |
+ } |
|
110 |
+ }, |
|
111 |
+ { |
|
112 |
+ "kind": "DeploymentConfig", |
|
113 |
+ "apiVersion": "v1", |
|
114 |
+ "metadata": { |
|
115 |
+ "name": "dancer-mysql-example", |
|
116 |
+ "annotations": { |
|
117 |
+ "description": "Defines how to deploy the application server" |
|
118 |
+ } |
|
119 |
+ }, |
|
120 |
+ "spec": { |
|
121 |
+ "triggers": [ |
|
122 |
+ { |
|
123 |
+ "type": "ImageChange", |
|
124 |
+ "imageChangeParams": { |
|
125 |
+ "automatic": true, |
|
126 |
+ "containerNames": [ |
|
127 |
+ "dancer-mysql-example" |
|
128 |
+ ], |
|
129 |
+ "from": { |
|
130 |
+ "kind": "ImageStreamTag", |
|
131 |
+ "name": "dancer-mysql-example:latest" |
|
132 |
+ } |
|
133 |
+ } |
|
134 |
+ }, |
|
135 |
+ { |
|
136 |
+ "type": "ConfigChange" |
|
137 |
+ } |
|
138 |
+ ], |
|
139 |
+ "replicas": 1, |
|
140 |
+ "selector": { |
|
141 |
+ "name": "dancer-mysql-example" |
|
142 |
+ }, |
|
143 |
+ "template": { |
|
144 |
+ "metadata": { |
|
145 |
+ "name": "dancer-mysql-example", |
|
146 |
+ "labels": { |
|
147 |
+ "name": "dancer-mysql-example" |
|
148 |
+ } |
|
149 |
+ }, |
|
150 |
+ "spec": { |
|
151 |
+ "containers": [ |
|
152 |
+ { |
|
153 |
+ "name": "dancer-mysql-example", |
|
154 |
+ "image": "dancer-mysql-example", |
|
155 |
+ "ports": [ |
|
156 |
+ { |
|
157 |
+ "containerPort": 8080 |
|
158 |
+ } |
|
159 |
+ ], |
|
160 |
+ "env": [ |
|
161 |
+ { |
|
162 |
+ "name": "DATABASE_SERVICE_NAME", |
|
163 |
+ "value": "${DATABASE_SERVICE_NAME}" |
|
164 |
+ }, |
|
165 |
+ { |
|
166 |
+ "name": "MYSQL_USER", |
|
167 |
+ "value": "${DATABASE_USER}" |
|
168 |
+ }, |
|
169 |
+ { |
|
170 |
+ "name": "MYSQL_PASSWORD", |
|
171 |
+ "value": "${DATABASE_PASSWORD}" |
|
172 |
+ }, |
|
173 |
+ { |
|
174 |
+ "name": "MYSQL_DATABASE", |
|
175 |
+ "value": "${DATABASE_NAME}" |
|
176 |
+ }, |
|
177 |
+ { |
|
178 |
+ "name": "SECRET_KEY_BASE", |
|
179 |
+ "value": "${SECRET_KEY_BASE}" |
|
180 |
+ }, |
|
181 |
+ { |
|
182 |
+ "name": "PERL_APACHE2_RELOAD", |
|
183 |
+ "value": "${PERL_APACHE2_RELOAD}" |
|
184 |
+ } |
|
185 |
+ ] |
|
186 |
+ } |
|
187 |
+ ] |
|
188 |
+ } |
|
189 |
+ } |
|
190 |
+ } |
|
191 |
+ }, |
|
192 |
+ { |
|
193 |
+ "kind": "Service", |
|
194 |
+ "apiVersion": "v1", |
|
195 |
+ "metadata": { |
|
196 |
+ "name": "${DATABASE_SERVICE_NAME}", |
|
197 |
+ "annotations": { |
|
198 |
+ "description": "Exposes the database server" |
|
199 |
+ } |
|
200 |
+ }, |
|
201 |
+ "spec": { |
|
202 |
+ "ports": [ |
|
203 |
+ { |
|
204 |
+ "name": "mysql", |
|
205 |
+ "port": 3306, |
|
206 |
+ "targetPort": 3306 |
|
207 |
+ } |
|
208 |
+ ], |
|
209 |
+ "selector": { |
|
210 |
+ "name": "${DATABASE_SERVICE_NAME}" |
|
211 |
+ } |
|
212 |
+ } |
|
213 |
+ }, |
|
214 |
+ { |
|
215 |
+ "kind": "DeploymentConfig", |
|
216 |
+ "apiVersion": "v1", |
|
217 |
+ "metadata": { |
|
218 |
+ "name": "${DATABASE_SERVICE_NAME}", |
|
219 |
+ "annotations": { |
|
220 |
+ "description": "Defines how to deploy the database" |
|
221 |
+ } |
|
222 |
+ }, |
|
223 |
+ "spec": { |
|
224 |
+ "strategy": { |
|
225 |
+ "type": "Recreate" |
|
226 |
+ }, |
|
227 |
+ "triggers": [ |
|
228 |
+ { |
|
229 |
+ "type": "ImageChange", |
|
230 |
+ "imageChangeParams": { |
|
231 |
+ "automatic": false, |
|
232 |
+ "containerNames": [ |
|
233 |
+ "mysql" |
|
234 |
+ ], |
|
235 |
+ "from": { |
|
236 |
+ "kind": "ImageStreamTag", |
|
237 |
+ "namespace": "openshift", |
|
238 |
+ "name": "mysql:5.6" |
|
239 |
+ } |
|
240 |
+ } |
|
241 |
+ }, |
|
242 |
+ { |
|
243 |
+ "type": "ConfigChange" |
|
244 |
+ } |
|
245 |
+ ], |
|
246 |
+ "replicas": 1, |
|
247 |
+ "selector": { |
|
248 |
+ "name": "${DATABASE_SERVICE_NAME}" |
|
249 |
+ }, |
|
250 |
+ "template": { |
|
251 |
+ "metadata": { |
|
252 |
+ "name": "${DATABASE_SERVICE_NAME}", |
|
253 |
+ "labels": { |
|
254 |
+ "name": "${DATABASE_SERVICE_NAME}" |
|
255 |
+ } |
|
256 |
+ }, |
|
257 |
+ "spec": { |
|
258 |
+ "containers": [ |
|
259 |
+ { |
|
260 |
+ "name": "mysql", |
|
261 |
+ "image": "mysql", |
|
262 |
+ "ports": [ |
|
263 |
+ { |
|
264 |
+ "containerPort": 3306 |
|
265 |
+ } |
|
266 |
+ ], |
|
267 |
+ "env": [ |
|
268 |
+ { |
|
269 |
+ "name": "MYSQL_USER", |
|
270 |
+ "value": "${DATABASE_USER}" |
|
271 |
+ }, |
|
272 |
+ { |
|
273 |
+ "name": "MYSQL_PASSWORD", |
|
274 |
+ "value": "${DATABASE_PASSWORD}" |
|
275 |
+ }, |
|
276 |
+ { |
|
277 |
+ "name": "MYSQL_DATABASE", |
|
278 |
+ "value": "${DATABASE_NAME}" |
|
279 |
+ } |
|
280 |
+ ] |
|
281 |
+ } |
|
282 |
+ ] |
|
283 |
+ } |
|
284 |
+ } |
|
285 |
+ } |
|
286 |
+ } |
|
287 |
+ ], |
|
288 |
+ "parameters": [ |
|
289 |
+ { |
|
290 |
+ "name": "SOURCE_REPOSITORY_URL", |
|
291 |
+ "description": "The URL of the repository with your application source code", |
|
292 |
+ "value": "https://github.com/openshift/dancer-ex.git" |
|
293 |
+ }, |
|
294 |
+ { |
|
295 |
+ "name": "SOURCE_REPOSITORY_REF", |
|
296 |
+ "description": "Set this to a branch name, tag or other ref of your repository if you are not using the default branch" |
|
297 |
+ }, |
|
298 |
+ { |
|
299 |
+ "name": "CONTEXT_DIR", |
|
300 |
+ "description": "Set this to the relative path to your project if it is not in the root of your repository" |
|
301 |
+ }, |
|
302 |
+ { |
|
303 |
+ "name": "APPLICATION_DOMAIN", |
|
304 |
+ "description": "The exposed hostname that will route to the Dancer service, if left blank a value will be defaulted.", |
|
305 |
+ "value": "" |
|
306 |
+ }, |
|
307 |
+ { |
|
308 |
+ "name": "GITHUB_WEBHOOK_SECRET", |
|
309 |
+ "description": "A secret string used to configure the GitHub webhook", |
|
310 |
+ "generate": "expression", |
|
311 |
+ "from": "[a-zA-Z0-9]{40}" |
|
312 |
+ }, |
|
313 |
+ { |
|
314 |
+ "name": "ADMIN_USERNAME", |
|
315 |
+ "description": "administrator username", |
|
316 |
+ "generate": "expression", |
|
317 |
+ "from": "admin[A-Z0-9]{3}" |
|
318 |
+ }, |
|
319 |
+ { |
|
320 |
+ "name": "ADMIN_PASSWORD", |
|
321 |
+ "description": "administrator password", |
|
322 |
+ "generate": "expression", |
|
323 |
+ "from": "[a-zA-Z0-9]{8}" |
|
324 |
+ }, |
|
325 |
+ { |
|
326 |
+ "name": "DATABASE_SERVICE_NAME", |
|
327 |
+ "description": "Database service name", |
|
328 |
+ "value": "database" |
|
329 |
+ }, |
|
330 |
+ { |
|
331 |
+ "name": "DATABASE_USER", |
|
332 |
+ "description": "database username", |
|
333 |
+ "generate": "expression", |
|
334 |
+ "from": "user[A-Z0-9]{3}" |
|
335 |
+ }, |
|
336 |
+ { |
|
337 |
+ "name": "DATABASE_PASSWORD", |
|
338 |
+ "description": "database password", |
|
339 |
+ "generate": "expression", |
|
340 |
+ "from": "[a-zA-Z0-9]{8}" |
|
341 |
+ }, |
|
342 |
+ { |
|
343 |
+ "name": "DATABASE_NAME", |
|
344 |
+ "description": "database name", |
|
345 |
+ "value": "sampledb" |
|
346 |
+ }, |
|
347 |
+ { |
|
348 |
+ "name": "PERL_APACHE2_RELOAD", |
|
349 |
+ "description": "Set this to \"true\" to enable automatic reloading of modified Perl modules", |
|
350 |
+ "value": "" |
|
351 |
+ }, |
|
352 |
+ { |
|
353 |
+ "name": "SECRET_KEY_BASE", |
|
354 |
+ "description": "Your secret key for verifying the integrity of signed cookies", |
|
355 |
+ "generate": "expression", |
|
356 |
+ "from": "[a-z0-9]{127}" |
|
357 |
+ } |
|
358 |
+ ] |
|
359 |
+} |
0 | 360 |
new file mode 100644 |
... | ... |
@@ -0,0 +1,358 @@ |
0 |
+{ |
|
1 |
+ "kind": "Template", |
|
2 |
+ "apiVersion": "v1", |
|
3 |
+ "metadata": { |
|
4 |
+ "name": "django-psql-example", |
|
5 |
+ "annotations": { |
|
6 |
+ "description": "An example Django application with a PostgreSQL database", |
|
7 |
+ "tags": "instant-app,python,django,postgresql", |
|
8 |
+ "iconClass": "icon-python" |
|
9 |
+ } |
|
10 |
+ }, |
|
11 |
+ "labels": { |
|
12 |
+ "template": "django-psql-example" |
|
13 |
+ }, |
|
14 |
+ "objects": [ |
|
15 |
+ { |
|
16 |
+ "kind": "Service", |
|
17 |
+ "apiVersion": "v1", |
|
18 |
+ "metadata": { |
|
19 |
+ "name": "django-psql-example", |
|
20 |
+ "annotations": { |
|
21 |
+ "description": "Exposes and load balances the application pods" |
|
22 |
+ } |
|
23 |
+ }, |
|
24 |
+ "spec": { |
|
25 |
+ "ports": [ |
|
26 |
+ { |
|
27 |
+ "name": "web", |
|
28 |
+ "port": 8080, |
|
29 |
+ "targetPort": 8080 |
|
30 |
+ } |
|
31 |
+ ], |
|
32 |
+ "selector": { |
|
33 |
+ "name": "django-psql-example" |
|
34 |
+ } |
|
35 |
+ } |
|
36 |
+ }, |
|
37 |
+ { |
|
38 |
+ "kind": "Route", |
|
39 |
+ "apiVersion": "v1", |
|
40 |
+ "metadata": { |
|
41 |
+ "name": "django-psql-example" |
|
42 |
+ }, |
|
43 |
+ "spec": { |
|
44 |
+ "host": "${APPLICATION_DOMAIN}", |
|
45 |
+ "to": { |
|
46 |
+ "kind": "Service", |
|
47 |
+ "name": "django-psql-example" |
|
48 |
+ } |
|
49 |
+ } |
|
50 |
+ }, |
|
51 |
+ { |
|
52 |
+ "kind": "ImageStream", |
|
53 |
+ "apiVersion": "v1", |
|
54 |
+ "metadata": { |
|
55 |
+ "name": "django-psql-example", |
|
56 |
+ "annotations": { |
|
57 |
+ "description": "Keeps track of changes in the application image" |
|
58 |
+ } |
|
59 |
+ } |
|
60 |
+ }, |
|
61 |
+ { |
|
62 |
+ "kind": "BuildConfig", |
|
63 |
+ "apiVersion": "v1", |
|
64 |
+ "metadata": { |
|
65 |
+ "name": "django-psql-example", |
|
66 |
+ "annotations": { |
|
67 |
+ "description": "Defines how to build the application" |
|
68 |
+ } |
|
69 |
+ }, |
|
70 |
+ "spec": { |
|
71 |
+ "source": { |
|
72 |
+ "type": "Git", |
|
73 |
+ "git": { |
|
74 |
+ "uri": "${SOURCE_REPOSITORY_URL}", |
|
75 |
+ "ref": "${SOURCE_REPOSITORY_REF}" |
|
76 |
+ }, |
|
77 |
+ "contextDir": "${CONTEXT_DIR}" |
|
78 |
+ }, |
|
79 |
+ "strategy": { |
|
80 |
+ "type": "Source", |
|
81 |
+ "sourceStrategy": { |
|
82 |
+ "from": { |
|
83 |
+ "kind": "ImageStreamTag", |
|
84 |
+ "namespace": "openshift", |
|
85 |
+ "name": "python:3.4" |
|
86 |
+ } |
|
87 |
+ } |
|
88 |
+ }, |
|
89 |
+ "output": { |
|
90 |
+ "to": { |
|
91 |
+ "kind": "ImageStreamTag", |
|
92 |
+ "name": "django-psql-example:latest" |
|
93 |
+ } |
|
94 |
+ }, |
|
95 |
+ "triggers": [ |
|
96 |
+ { |
|
97 |
+ "type": "ImageChange" |
|
98 |
+ }, |
|
99 |
+ { |
|
100 |
+ "type": "ConfigChange" |
|
101 |
+ }, |
|
102 |
+ { |
|
103 |
+ "type": "GitHub", |
|
104 |
+ "github": { |
|
105 |
+ "secret": "${GITHUB_WEBHOOK_SECRET}" |
|
106 |
+ } |
|
107 |
+ } |
|
108 |
+ ] |
|
109 |
+ } |
|
110 |
+ }, |
|
111 |
+ { |
|
112 |
+ "kind": "DeploymentConfig", |
|
113 |
+ "apiVersion": "v1", |
|
114 |
+ "metadata": { |
|
115 |
+ "name": "django-psql-example", |
|
116 |
+ "annotations": { |
|
117 |
+ "description": "Defines how to deploy the application server" |
|
118 |
+ } |
|
119 |
+ }, |
|
120 |
+ "spec": { |
|
121 |
+ "strategy": { |
|
122 |
+ "type": "Rolling" |
|
123 |
+ }, |
|
124 |
+ "triggers": [ |
|
125 |
+ { |
|
126 |
+ "type": "ImageChange", |
|
127 |
+ "imageChangeParams": { |
|
128 |
+ "automatic": true, |
|
129 |
+ "containerNames": [ |
|
130 |
+ "django-psql-example" |
|
131 |
+ ], |
|
132 |
+ "from": { |
|
133 |
+ "kind": "ImageStreamTag", |
|
134 |
+ "name": "django-psql-example:latest" |
|
135 |
+ } |
|
136 |
+ } |
|
137 |
+ }, |
|
138 |
+ { |
|
139 |
+ "type": "ConfigChange" |
|
140 |
+ } |
|
141 |
+ ], |
|
142 |
+ "replicas": 1, |
|
143 |
+ "selector": { |
|
144 |
+ "name": "django-psql-example" |
|
145 |
+ }, |
|
146 |
+ "template": { |
|
147 |
+ "metadata": { |
|
148 |
+ "name": "django-psql-example", |
|
149 |
+ "labels": { |
|
150 |
+ "name": "django-psql-example" |
|
151 |
+ } |
|
152 |
+ }, |
|
153 |
+ "spec": { |
|
154 |
+ "containers": [ |
|
155 |
+ { |
|
156 |
+ "name": "django-psql-example", |
|
157 |
+ "image": "django-psql-example", |
|
158 |
+ "ports": [ |
|
159 |
+ { |
|
160 |
+ "containerPort": 8080 |
|
161 |
+ } |
|
162 |
+ ], |
|
163 |
+ "env": [ |
|
164 |
+ { |
|
165 |
+ "name": "DATABASE_SERVICE_NAME", |
|
166 |
+ "value": "${DATABASE_SERVICE_NAME}" |
|
167 |
+ }, |
|
168 |
+ { |
|
169 |
+ "name": "DATABASE_ENGINE", |
|
170 |
+ "value": "${DATABASE_ENGINE}" |
|
171 |
+ }, |
|
172 |
+ { |
|
173 |
+ "name": "DATABASE_NAME", |
|
174 |
+ "value": "${DATABASE_NAME}" |
|
175 |
+ }, |
|
176 |
+ { |
|
177 |
+ "name": "DATABASE_USER", |
|
178 |
+ "value": "${DATABASE_USER}" |
|
179 |
+ }, |
|
180 |
+ { |
|
181 |
+ "name": "DATABASE_PASSWORD", |
|
182 |
+ "value": "${DATABASE_PASSWORD}" |
|
183 |
+ }, |
|
184 |
+ { |
|
185 |
+ "name": "APP_CONFIG", |
|
186 |
+ "value": "${APP_CONFIG}" |
|
187 |
+ }, |
|
188 |
+ { |
|
189 |
+ "name": "DJANGO_SECRET_KEY", |
|
190 |
+ "value": "${DJANGO_SECRET_KEY}" |
|
191 |
+ } |
|
192 |
+ ] |
|
193 |
+ } |
|
194 |
+ ] |
|
195 |
+ } |
|
196 |
+ } |
|
197 |
+ } |
|
198 |
+ }, |
|
199 |
+ { |
|
200 |
+ "kind": "Service", |
|
201 |
+ "apiVersion": "v1", |
|
202 |
+ "metadata": { |
|
203 |
+ "name": "${DATABASE_SERVICE_NAME}", |
|
204 |
+ "annotations": { |
|
205 |
+ "description": "Exposes the database server" |
|
206 |
+ } |
|
207 |
+ }, |
|
208 |
+ "spec": { |
|
209 |
+ "ports": [ |
|
210 |
+ { |
|
211 |
+ "name": "postgresql", |
|
212 |
+ "port": 5432, |
|
213 |
+ "targetPort": 5432 |
|
214 |
+ } |
|
215 |
+ ], |
|
216 |
+ "selector": { |
|
217 |
+ "name": "${DATABASE_SERVICE_NAME}" |
|
218 |
+ } |
|
219 |
+ } |
|
220 |
+ }, |
|
221 |
+ { |
|
222 |
+ "kind": "DeploymentConfig", |
|
223 |
+ "apiVersion": "v1", |
|
224 |
+ "metadata": { |
|
225 |
+ "name": "${DATABASE_SERVICE_NAME}", |
|
226 |
+ "annotations": { |
|
227 |
+ "description": "Defines how to deploy the database" |
|
228 |
+ } |
|
229 |
+ }, |
|
230 |
+ "spec": { |
|
231 |
+ "strategy": { |
|
232 |
+ "type": "Recreate" |
|
233 |
+ }, |
|
234 |
+ "triggers": [ |
|
235 |
+ { |
|
236 |
+ "type": "ImageChange", |
|
237 |
+ "imageChangeParams": { |
|
238 |
+ "automatic": false, |
|
239 |
+ "containerNames": [ |
|
240 |
+ "postgresql" |
|
241 |
+ ], |
|
242 |
+ "from": { |
|
243 |
+ "kind": "ImageStreamTag", |
|
244 |
+ "namespace": "openshift", |
|
245 |
+ "name": "postgresql:9.4" |
|
246 |
+ } |
|
247 |
+ } |
|
248 |
+ }, |
|
249 |
+ { |
|
250 |
+ "type": "ConfigChange" |
|
251 |
+ } |
|
252 |
+ ], |
|
253 |
+ "replicas": 1, |
|
254 |
+ "selector": { |
|
255 |
+ "name": "${DATABASE_SERVICE_NAME}" |
|
256 |
+ }, |
|
257 |
+ "template": { |
|
258 |
+ "metadata": { |
|
259 |
+ "name": "${DATABASE_SERVICE_NAME}", |
|
260 |
+ "labels": { |
|
261 |
+ "name": "${DATABASE_SERVICE_NAME}" |
|
262 |
+ } |
|
263 |
+ }, |
|
264 |
+ "spec": { |
|
265 |
+ "containers": [ |
|
266 |
+ { |
|
267 |
+ "name": "postgresql", |
|
268 |
+ "image": "postgresql", |
|
269 |
+ "ports": [ |
|
270 |
+ { |
|
271 |
+ "containerPort": 5432 |
|
272 |
+ } |
|
273 |
+ ], |
|
274 |
+ "env": [ |
|
275 |
+ { |
|
276 |
+ "name": "POSTGRESQL_USER", |
|
277 |
+ "value": "${DATABASE_USER}" |
|
278 |
+ }, |
|
279 |
+ { |
|
280 |
+ "name": "POSTGRESQL_PASSWORD", |
|
281 |
+ "value": "${DATABASE_PASSWORD}" |
|
282 |
+ }, |
|
283 |
+ { |
|
284 |
+ "name": "POSTGRESQL_DATABASE", |
|
285 |
+ "value": "${DATABASE_NAME}" |
|
286 |
+ } |
|
287 |
+ ] |
|
288 |
+ } |
|
289 |
+ ] |
|
290 |
+ } |
|
291 |
+ } |
|
292 |
+ } |
|
293 |
+ } |
|
294 |
+ ], |
|
295 |
+ "parameters": [ |
|
296 |
+ { |
|
297 |
+ "name": "SOURCE_REPOSITORY_URL", |
|
298 |
+ "description": "The URL of the repository with your application source code", |
|
299 |
+ "value": "https://github.com/openshift/django-ex.git" |
|
300 |
+ }, |
|
301 |
+ { |
|
302 |
+ "name": "SOURCE_REPOSITORY_REF", |
|
303 |
+ "description": "Set this to a branch name, tag or other ref of your repository if you are not using the default branch" |
|
304 |
+ }, |
|
305 |
+ { |
|
306 |
+ "name": "CONTEXT_DIR", |
|
307 |
+ "description": "Set this to the relative path to your project if it is not in the root of your repository" |
|
308 |
+ }, |
|
309 |
+ { |
|
310 |
+ "name": "APPLICATION_DOMAIN", |
|
311 |
+ "description": "The exposed hostname that will route to the Django service, if left blank a value will be defaulted.", |
|
312 |
+ "value": "" |
|
313 |
+ }, |
|
314 |
+ { |
|
315 |
+ "name": "GITHUB_WEBHOOK_SECRET", |
|
316 |
+ "description": "A secret string used to configure the GitHub webhook", |
|
317 |
+ "generate": "expression", |
|
318 |
+ "from": "[a-zA-Z0-9]{40}" |
|
319 |
+ }, |
|
320 |
+ { |
|
321 |
+ "name": "DATABASE_SERVICE_NAME", |
|
322 |
+ "description": "Database service name", |
|
323 |
+ "value": "postgresql" |
|
324 |
+ }, |
|
325 |
+ { |
|
326 |
+ "name": "DATABASE_ENGINE", |
|
327 |
+ "description": "Database engine: postgresql, mysql or sqlite (default)", |
|
328 |
+ "value": "postgresql" |
|
329 |
+ }, |
|
330 |
+ { |
|
331 |
+ "name": "DATABASE_NAME", |
|
332 |
+ "description": "Database name", |
|
333 |
+ "value": "default" |
|
334 |
+ }, |
|
335 |
+ { |
|
336 |
+ "name": "DATABASE_USER", |
|
337 |
+ "description": "Database user name", |
|
338 |
+ "value": "django" |
|
339 |
+ }, |
|
340 |
+ { |
|
341 |
+ "name": "DATABASE_PASSWORD", |
|
342 |
+ "description": "Database user password", |
|
343 |
+ "generate": "expression", |
|
344 |
+ "from": "[a-zA-Z0-9]{16}" |
|
345 |
+ }, |
|
346 |
+ { |
|
347 |
+ "name": "APP_CONFIG", |
|
348 |
+ "description": "Relative path to Gunicorn configuration file (optional)" |
|
349 |
+ }, |
|
350 |
+ { |
|
351 |
+ "name": "DJANGO_SECRET_KEY", |
|
352 |
+ "description": "Set this to a long random string", |
|
353 |
+ "generate": "expression", |
|
354 |
+ "from": "[\\w]{50}" |
|
355 |
+ } |
|
356 |
+ ] |
|
357 |
+} |
0 | 358 |
new file mode 100644 |
... | ... |
@@ -0,0 +1,358 @@ |
0 |
+{ |
|
1 |
+ "kind": "Template", |
|
2 |
+ "apiVersion": "v1", |
|
3 |
+ "metadata": { |
|
4 |
+ "name": "nodejs-mongodb-example", |
|
5 |
+ "annotations": { |
|
6 |
+ "description": "An example Node.js application with a MongoDB database", |
|
7 |
+ "tags": "instant-app,nodejs,mongodb", |
|
8 |
+ "iconClass": "icon-nodejs" |
|
9 |
+ } |
|
10 |
+ }, |
|
11 |
+ "labels": { |
|
12 |
+ "template": "nodejs-mongodb-example" |
|
13 |
+ }, |
|
14 |
+ "objects": [ |
|
15 |
+ { |
|
16 |
+ "kind": "Service", |
|
17 |
+ "apiVersion": "v1", |
|
18 |
+ "metadata": { |
|
19 |
+ "name": "nodejs-mongodb-example", |
|
20 |
+ "annotations": { |
|
21 |
+ "description": "Exposes and load balances the application pods" |
|
22 |
+ } |
|
23 |
+ }, |
|
24 |
+ "spec": { |
|
25 |
+ "ports": [ |
|
26 |
+ { |
|
27 |
+ "name": "web", |
|
28 |
+ "port": 8080, |
|
29 |
+ "targetPort": 8080 |
|
30 |
+ } |
|
31 |
+ ], |
|
32 |
+ "selector": { |
|
33 |
+ "name": "nodejs-mongodb-example" |
|
34 |
+ } |
|
35 |
+ } |
|
36 |
+ }, |
|
37 |
+ { |
|
38 |
+ "kind": "Route", |
|
39 |
+ "apiVersion": "v1", |
|
40 |
+ "metadata": { |
|
41 |
+ "name": "nodejs-mongodb-example" |
|
42 |
+ }, |
|
43 |
+ "spec": { |
|
44 |
+ "host": "${APPLICATION_DOMAIN}", |
|
45 |
+ "to": { |
|
46 |
+ "kind": "Service", |
|
47 |
+ "name": "nodejs-mongodb-example" |
|
48 |
+ } |
|
49 |
+ } |
|
50 |
+ }, |
|
51 |
+ { |
|
52 |
+ "kind": "ImageStream", |
|
53 |
+ "apiVersion": "v1", |
|
54 |
+ "metadata": { |
|
55 |
+ "name": "nodejs-mongodb-example", |
|
56 |
+ "annotations": { |
|
57 |
+ "description": "Keeps track of changes in the application image" |
|
58 |
+ } |
|
59 |
+ } |
|
60 |
+ }, |
|
61 |
+ { |
|
62 |
+ "kind": "BuildConfig", |
|
63 |
+ "apiVersion": "v1", |
|
64 |
+ "metadata": { |
|
65 |
+ "name": "nodejs-mongodb-example", |
|
66 |
+ "annotations": { |
|
67 |
+ "description": "Defines how to build the application" |
|
68 |
+ } |
|
69 |
+ }, |
|
70 |
+ "spec": { |
|
71 |
+ "source": { |
|
72 |
+ "type": "Git", |
|
73 |
+ "git": { |
|
74 |
+ "uri": "${SOURCE_REPOSITORY_URL}", |
|
75 |
+ "ref": "${SOURCE_REPOSITORY_REF}" |
|
76 |
+ }, |
|
77 |
+ "contextDir": "${CONTEXT_DIR}" |
|
78 |
+ }, |
|
79 |
+ "strategy": { |
|
80 |
+ "type": "Source", |
|
81 |
+ "sourceStrategy": { |
|
82 |
+ "from": { |
|
83 |
+ "kind": "ImageStreamTag", |
|
84 |
+ "namespace": "openshift", |
|
85 |
+ "name": "nodejs:0.10" |
|
86 |
+ } |
|
87 |
+ } |
|
88 |
+ }, |
|
89 |
+ "output": { |
|
90 |
+ "to": { |
|
91 |
+ "kind": "ImageStreamTag", |
|
92 |
+ "name": "nodejs-mongodb-example:latest" |
|
93 |
+ } |
|
94 |
+ }, |
|
95 |
+ "triggers": [ |
|
96 |
+ { |
|
97 |
+ "type": "ImageChange" |
|
98 |
+ }, |
|
99 |
+ { |
|
100 |
+ "type": "ConfigChange" |
|
101 |
+ }, |
|
102 |
+ { |
|
103 |
+ "type": "GitHub", |
|
104 |
+ "github": { |
|
105 |
+ "secret": "${GITHUB_WEBHOOK_SECRET}" |
|
106 |
+ } |
|
107 |
+ }, |
|
108 |
+ { |
|
109 |
+ "type": "Generic", |
|
110 |
+ "generic": { |
|
111 |
+ "secret": "${GENERIC_WEBHOOK_SECRET}" |
|
112 |
+ } |
|
113 |
+ } |
|
114 |
+ ] |
|
115 |
+ } |
|
116 |
+ }, |
|
117 |
+ { |
|
118 |
+ "kind": "DeploymentConfig", |
|
119 |
+ "apiVersion": "v1", |
|
120 |
+ "metadata": { |
|
121 |
+ "name": "nodejs-mongodb-example", |
|
122 |
+ "annotations": { |
|
123 |
+ "description": "Defines how to deploy the application server" |
|
124 |
+ } |
|
125 |
+ }, |
|
126 |
+ "spec": { |
|
127 |
+ "strategy": { |
|
128 |
+ "type": "Rolling" |
|
129 |
+ }, |
|
130 |
+ "triggers": [ |
|
131 |
+ { |
|
132 |
+ "type": "ImageChange", |
|
133 |
+ "imageChangeParams": { |
|
134 |
+ "automatic": true, |
|
135 |
+ "containerNames": [ |
|
136 |
+ "nodejs-mongodb-example" |
|
137 |
+ ], |
|
138 |
+ "from": { |
|
139 |
+ "kind": "ImageStreamTag", |
|
140 |
+ "name": "nodejs-mongodb-example:latest" |
|
141 |
+ } |
|
142 |
+ } |
|
143 |
+ }, |
|
144 |
+ { |
|
145 |
+ "type": "ConfigChange" |
|
146 |
+ } |
|
147 |
+ ], |
|
148 |
+ "replicas": 1, |
|
149 |
+ "selector": { |
|
150 |
+ "name": "nodejs-mongodb-example" |
|
151 |
+ }, |
|
152 |
+ "template": { |
|
153 |
+ "metadata": { |
|
154 |
+ "name": "nodejs-mongodb-example", |
|
155 |
+ "labels": { |
|
156 |
+ "name": "nodejs-mongodb-example" |
|
157 |
+ } |
|
158 |
+ }, |
|
159 |
+ "spec": { |
|
160 |
+ "containers": [ |
|
161 |
+ { |
|
162 |
+ "name": "nodejs-mongodb-example", |
|
163 |
+ "image": "nodejs-mongodb-example", |
|
164 |
+ "ports": [ |
|
165 |
+ { |
|
166 |
+ "containerPort": 8080 |
|
167 |
+ } |
|
168 |
+ ], |
|
169 |
+ "env": [ |
|
170 |
+ { |
|
171 |
+ "name": "DATABASE_SERVICE_NAME", |
|
172 |
+ "value": "${DATABASE_SERVICE_NAME}" |
|
173 |
+ }, |
|
174 |
+ { |
|
175 |
+ "name": "MONGODB_USER", |
|
176 |
+ "value": "${DATABASE_USER}" |
|
177 |
+ }, |
|
178 |
+ { |
|
179 |
+ "name": "MONGODB_PASSWORD", |
|
180 |
+ "value": "${DATABASE_PASSWORD}" |
|
181 |
+ }, |
|
182 |
+ { |
|
183 |
+ "name": "MONGODB_DATABASE", |
|
184 |
+ "value": "${DATABASE_NAME}" |
|
185 |
+ }, |
|
186 |
+ { |
|
187 |
+ "name": "MONGODB_ADMIN_PASSWORD", |
|
188 |
+ "value": "${DATABASE_ADMIN_PASSWORD}" |
|
189 |
+ } |
|
190 |
+ ] |
|
191 |
+ } |
|
192 |
+ ] |
|
193 |
+ } |
|
194 |
+ } |
|
195 |
+ } |
|
196 |
+ }, |
|
197 |
+ { |
|
198 |
+ "kind": "Service", |
|
199 |
+ "apiVersion": "v1", |
|
200 |
+ "metadata": { |
|
201 |
+ "name": "${DATABASE_SERVICE_NAME}", |
|
202 |
+ "annotations": { |
|
203 |
+ "description": "Exposes the database server" |
|
204 |
+ } |
|
205 |
+ }, |
|
206 |
+ "spec": { |
|
207 |
+ "ports": [ |
|
208 |
+ { |
|
209 |
+ "name": "mongodb", |
|
210 |
+ "port": 27017, |
|
211 |
+ "targetPort": 27017 |
|
212 |
+ } |
|
213 |
+ ], |
|
214 |
+ "selector": { |
|
215 |
+ "name": "${DATABASE_SERVICE_NAME}" |
|
216 |
+ } |
|
217 |
+ } |
|
218 |
+ }, |
|
219 |
+ { |
|
220 |
+ "kind": "DeploymentConfig", |
|
221 |
+ "apiVersion": "v1", |
|
222 |
+ "metadata": { |
|
223 |
+ "name": "${DATABASE_SERVICE_NAME}", |
|
224 |
+ "annotations": { |
|
225 |
+ "description": "Defines how to deploy the database" |
|
226 |
+ } |
|
227 |
+ }, |
|
228 |
+ "spec": { |
|
229 |
+ "strategy": { |
|
230 |
+ "type": "Recreate" |
|
231 |
+ }, |
|
232 |
+ "triggers": [ |
|
233 |
+ { |
|
234 |
+ "type": "ImageChange", |
|
235 |
+ "imageChangeParams": { |
|
236 |
+ "automatic": false, |
|
237 |
+ "containerNames": [ |
|
238 |
+ "mongodb" |
|
239 |
+ ], |
|
240 |
+ "from": { |
|
241 |
+ "kind": "ImageStreamTag", |
|
242 |
+ "namespace": "openshift", |
|
243 |
+ "name": "mongodb:2.6" |
|
244 |
+ } |
|
245 |
+ } |
|
246 |
+ }, |
|
247 |
+ { |
|
248 |
+ "type": "ConfigChange" |
|
249 |
+ } |
|
250 |
+ ], |
|
251 |
+ "replicas": 1, |
|
252 |
+ "selector": { |
|
253 |
+ "name": "${DATABASE_SERVICE_NAME}" |
|
254 |
+ }, |
|
255 |
+ "template": { |
|
256 |
+ "metadata": { |
|
257 |
+ "name": "${DATABASE_SERVICE_NAME}", |
|
258 |
+ "labels": { |
|
259 |
+ "name": "${DATABASE_SERVICE_NAME}" |
|
260 |
+ } |
|
261 |
+ }, |
|
262 |
+ "spec": { |
|
263 |
+ "containers": [ |
|
264 |
+ { |
|
265 |
+ "name": "mongodb", |
|
266 |
+ "image": "mongodb", |
|
267 |
+ "ports": [ |
|
268 |
+ { |
|
269 |
+ "containerPort": 27017 |
|
270 |
+ } |
|
271 |
+ ], |
|
272 |
+ "env": [ |
|
273 |
+ { |
|
274 |
+ "name": "MONGODB_USER", |
|
275 |
+ "value": "${DATABASE_USER}" |
|
276 |
+ }, |
|
277 |
+ { |
|
278 |
+ "name": "MONGODB_PASSWORD", |
|
279 |
+ "value": "${DATABASE_PASSWORD}" |
|
280 |
+ }, |
|
281 |
+ { |
|
282 |
+ "name": "MONGODB_DATABASE", |
|
283 |
+ "value": "${DATABASE_NAME}" |
|
284 |
+ }, |
|
285 |
+ { |
|
286 |
+ "name": "MONGODB_ADMIN_PASSWORD", |
|
287 |
+ "value": "${DATABASE_ADMIN_PASSWORD}" |
|
288 |
+ } |
|
289 |
+ ] |
|
290 |
+ } |
|
291 |
+ ] |
|
292 |
+ } |
|
293 |
+ } |
|
294 |
+ } |
|
295 |
+ } |
|
296 |
+ ], |
|
297 |
+ "parameters": [ |
|
298 |
+ { |
|
299 |
+ "name": "SOURCE_REPOSITORY_URL", |
|
300 |
+ "description": "The URL of the repository with your application source code", |
|
301 |
+ "value": "https://github.com/openshift/nodejs-ex.git" |
|
302 |
+ }, |
|
303 |
+ { |
|
304 |
+ "name": "SOURCE_REPOSITORY_REF", |
|
305 |
+ "description": "Set this to a branch name, tag or other ref of your repository if you are not using the default branch" |
|
306 |
+ }, |
|
307 |
+ { |
|
308 |
+ "name": "CONTEXT_DIR", |
|
309 |
+ "description": "Set this to the relative path to your project if it is not in the root of your repository" |
|
310 |
+ }, |
|
311 |
+ { |
|
312 |
+ "name": "APPLICATION_DOMAIN", |
|
313 |
+ "description": "The exposed hostname that will route to the Node.js service, if left blank a value will be defaulted.", |
|
314 |
+ "value": "" |
|
315 |
+ }, |
|
316 |
+ { |
|
317 |
+ "name": "GITHUB_WEBHOOK_SECRET", |
|
318 |
+ "description": "A secret string used to configure the GitHub webhook", |
|
319 |
+ "generate": "expression", |
|
320 |
+ "from": "[a-zA-Z0-9]{40}" |
|
321 |
+ }, |
|
322 |
+ { |
|
323 |
+ "name": "GENERIC_WEBHOOK_SECRET", |
|
324 |
+ "description": "A secret string used to configure the Generic webhook", |
|
325 |
+ "generate": "expression", |
|
326 |
+ "from": "[a-zA-Z0-9]{40}" |
|
327 |
+ }, |
|
328 |
+ { |
|
329 |
+ "name": "DATABASE_SERVICE_NAME", |
|
330 |
+ "description": "Database service name", |
|
331 |
+ "value": "mongodb" |
|
332 |
+ }, |
|
333 |
+ { |
|
334 |
+ "name": "DATABASE_USER", |
|
335 |
+ "description": "Username for MongoDB user that will be used for accessing the database", |
|
336 |
+ "generate": "expression", |
|
337 |
+ "from": "user[A-Z0-9]{3}" |
|
338 |
+ }, |
|
339 |
+ { |
|
340 |
+ "name": "DATABASE_PASSWORD", |
|
341 |
+ "description": "Password for the MongoDB user", |
|
342 |
+ "generate": "expression", |
|
343 |
+ "from": "[a-zA-Z0-9]{16}" |
|
344 |
+ }, |
|
345 |
+ { |
|
346 |
+ "name": "DATABASE_NAME", |
|
347 |
+ "description": "Database name", |
|
348 |
+ "value": "sampledb" |
|
349 |
+ }, |
|
350 |
+ { |
|
351 |
+ "name": "DATABASE_ADMIN_PASSWORD", |
|
352 |
+ "description": "Password for the database admin user", |
|
353 |
+ "generate": "expression", |
|
354 |
+ "from": "[a-zA-Z0-9]{16}" |
|
355 |
+ } |
|
356 |
+ ] |
|
357 |
+} |
0 | 358 |
new file mode 100644 |
... | ... |
@@ -0,0 +1,414 @@ |
0 |
+{ |
|
1 |
+ "kind": "Template", |
|
2 |
+ "apiVersion": "v1", |
|
3 |
+ "metadata": { |
|
4 |
+ "name": "rails-postgresql-example", |
|
5 |
+ "annotations": { |
|
6 |
+ "description": "An example Rails application with a PostgreSQL database", |
|
7 |
+ "tags": "instant-app,ruby,rails,postgresql", |
|
8 |
+ "iconClass": "icon-ruby" |
|
9 |
+ } |
|
10 |
+ }, |
|
11 |
+ "labels": { |
|
12 |
+ "template": "rails-postgresql-example" |
|
13 |
+ }, |
|
14 |
+ "objects": [ |
|
15 |
+ { |
|
16 |
+ "kind": "Service", |
|
17 |
+ "apiVersion": "v1", |
|
18 |
+ "metadata": { |
|
19 |
+ "name": "rails-postgresql-example", |
|
20 |
+ "annotations": { |
|
21 |
+ "description": "Exposes and load balances the application pods" |
|
22 |
+ } |
|
23 |
+ }, |
|
24 |
+ "spec": { |
|
25 |
+ "ports": [ |
|
26 |
+ { |
|
27 |
+ "name": "web", |
|
28 |
+ "port": 8080, |
|
29 |
+ "targetPort": 8080 |
|
30 |
+ } |
|
31 |
+ ], |
|
32 |
+ "selector": { |
|
33 |
+ "name": "rails-postgresql-example" |
|
34 |
+ } |
|
35 |
+ } |
|
36 |
+ }, |
|
37 |
+ { |
|
38 |
+ "kind": "Route", |
|
39 |
+ "apiVersion": "v1", |
|
40 |
+ "metadata": { |
|
41 |
+ "name": "rails-postgresql-example" |
|
42 |
+ }, |
|
43 |
+ "spec": { |
|
44 |
+ "host": "${APPLICATION_DOMAIN}", |
|
45 |
+ "to": { |
|
46 |
+ "kind": "Service", |
|
47 |
+ "name": "rails-postgresql-example" |
|
48 |
+ } |
|
49 |
+ } |
|
50 |
+ }, |
|
51 |
+ { |
|
52 |
+ "kind": "ImageStream", |
|
53 |
+ "apiVersion": "v1", |
|
54 |
+ "metadata": { |
|
55 |
+ "name": "rails-postgresql-example", |
|
56 |
+ "annotations": { |
|
57 |
+ "description": "Keeps track of changes in the application image" |
|
58 |
+ } |
|
59 |
+ } |
|
60 |
+ }, |
|
61 |
+ { |
|
62 |
+ "kind": "BuildConfig", |
|
63 |
+ "apiVersion": "v1", |
|
64 |
+ "metadata": { |
|
65 |
+ "name": "rails-postgresql-example", |
|
66 |
+ "annotations": { |
|
67 |
+ "description": "Defines how to build the application" |
|
68 |
+ } |
|
69 |
+ }, |
|
70 |
+ "spec": { |
|
71 |
+ "source": { |
|
72 |
+ "type": "Git", |
|
73 |
+ "git": { |
|
74 |
+ "uri": "${SOURCE_REPOSITORY_URL}", |
|
75 |
+ "ref": "${SOURCE_REPOSITORY_REF}" |
|
76 |
+ }, |
|
77 |
+ "contextDir": "${CONTEXT_DIR}" |
|
78 |
+ }, |
|
79 |
+ "strategy": { |
|
80 |
+ "type": "Source", |
|
81 |
+ "sourceStrategy": { |
|
82 |
+ "from": { |
|
83 |
+ "kind": "ImageStreamTag", |
|
84 |
+ "namespace": "openshift", |
|
85 |
+ "name": "ruby:2.2" |
|
86 |
+ } |
|
87 |
+ } |
|
88 |
+ }, |
|
89 |
+ "output": { |
|
90 |
+ "to": { |
|
91 |
+ "kind": "ImageStreamTag", |
|
92 |
+ "name": "rails-postgresql-example:latest" |
|
93 |
+ } |
|
94 |
+ }, |
|
95 |
+ "triggers": [ |
|
96 |
+ { |
|
97 |
+ "type": "ImageChange" |
|
98 |
+ }, |
|
99 |
+ { |
|
100 |
+ "type": "ConfigChange" |
|
101 |
+ }, |
|
102 |
+ { |
|
103 |
+ "type": "GitHub", |
|
104 |
+ "github": { |
|
105 |
+ "secret": "${GITHUB_WEBHOOK_SECRET}" |
|
106 |
+ } |
|
107 |
+ } |
|
108 |
+ ] |
|
109 |
+ } |
|
110 |
+ }, |
|
111 |
+ { |
|
112 |
+ "kind": "DeploymentConfig", |
|
113 |
+ "apiVersion": "v1", |
|
114 |
+ "metadata": { |
|
115 |
+ "name": "rails-postgresql-example", |
|
116 |
+ "annotations": { |
|
117 |
+ "description": "Defines how to deploy the application server" |
|
118 |
+ } |
|
119 |
+ }, |
|
120 |
+ "spec": { |
|
121 |
+ "strategy": { |
|
122 |
+ "type": "Recreate", |
|
123 |
+ "recreateParams": { |
|
124 |
+ "pre": { |
|
125 |
+ "failurePolicy": "Abort", |
|
126 |
+ "execNewPod": { |
|
127 |
+ "command": [ |
|
128 |
+ "./migrate-database.sh" |
|
129 |
+ ], |
|
130 |
+ "containerName": "rails-postgresql-example" |
|
131 |
+ } |
|
132 |
+ } |
|
133 |
+ } |
|
134 |
+ }, |
|
135 |
+ "triggers": [ |
|
136 |
+ { |
|
137 |
+ "type": "ImageChange", |
|
138 |
+ "imageChangeParams": { |
|
139 |
+ "automatic": true, |
|
140 |
+ "containerNames": [ |
|
141 |
+ "rails-postgresql-example" |
|
142 |
+ ], |
|
143 |
+ "from": { |
|
144 |
+ "kind": "ImageStreamTag", |
|
145 |
+ "name": "rails-postgresql-example:latest" |
|
146 |
+ } |
|
147 |
+ } |
|
148 |
+ }, |
|
149 |
+ { |
|
150 |
+ "type": "ConfigChange" |
|
151 |
+ } |
|
152 |
+ ], |
|
153 |
+ "replicas": 1, |
|
154 |
+ "selector": { |
|
155 |
+ "name": "rails-postgresql-example" |
|
156 |
+ }, |
|
157 |
+ "template": { |
|
158 |
+ "metadata": { |
|
159 |
+ "name": "rails-postgresql-example", |
|
160 |
+ "labels": { |
|
161 |
+ "name": "rails-postgresql-example" |
|
162 |
+ } |
|
163 |
+ }, |
|
164 |
+ "spec": { |
|
165 |
+ "containers": [ |
|
166 |
+ { |
|
167 |
+ "name": "rails-postgresql-example", |
|
168 |
+ "image": "rails-postgresql-example", |
|
169 |
+ "ports": [ |
|
170 |
+ { |
|
171 |
+ "containerPort": 8080 |
|
172 |
+ } |
|
173 |
+ ], |
|
174 |
+ "env": [ |
|
175 |
+ { |
|
176 |
+ "name": "DATABASE_SERVICE_NAME", |
|
177 |
+ "value": "${DATABASE_SERVICE_NAME}" |
|
178 |
+ }, |
|
179 |
+ { |
|
180 |
+ "name": "POSTGRESQL_USER", |
|
181 |
+ "value": "${DATABASE_USER}" |
|
182 |
+ }, |
|
183 |
+ { |
|
184 |
+ "name": "POSTGRESQL_PASSWORD", |
|
185 |
+ "value": "${DATABASE_PASSWORD}" |
|
186 |
+ }, |
|
187 |
+ { |
|
188 |
+ "name": "POSTGRESQL_DATABASE", |
|
189 |
+ "value": "${DATABASE_NAME}" |
|
190 |
+ }, |
|
191 |
+ { |
|
192 |
+ "name": "SECRET_KEY_BASE", |
|
193 |
+ "value": "${SECRET_KEY_BASE}" |
|
194 |
+ }, |
|
195 |
+ { |
|
196 |
+ "name": "POSTGRESQL_MAX_CONNECTIONS", |
|
197 |
+ "value": "${POSTGRESQL_MAX_CONNECTIONS}" |
|
198 |
+ }, |
|
199 |
+ { |
|
200 |
+ "name": "POSTGRESQL_SHARED_BUFFERS", |
|
201 |
+ "value": "${POSTGRESQL_SHARED_BUFFERS}" |
|
202 |
+ }, |
|
203 |
+ { |
|
204 |
+ "name": "SECRET_KEY_BASE", |
|
205 |
+ "value": "${SECRET_KEY_BASE}" |
|
206 |
+ }, |
|
207 |
+ { |
|
208 |
+ "name": "APPLICATION_DOMAIN", |
|
209 |
+ "value": "${APPLICATION_DOMAIN}" |
|
210 |
+ }, |
|
211 |
+ { |
|
212 |
+ "name": "APPLICATION_USER", |
|
213 |
+ "value": "${APPLICATION_USER}" |
|
214 |
+ }, |
|
215 |
+ { |
|
216 |
+ "name": "APPLICATION_PASSWORD", |
|
217 |
+ "value": "${APPLICATION_PASSWORD}" |
|
218 |
+ }, |
|
219 |
+ { |
|
220 |
+ "name": "RAILS_ENV", |
|
221 |
+ "value": "${RAILS_ENV}" |
|
222 |
+ } |
|
223 |
+ ] |
|
224 |
+ } |
|
225 |
+ ] |
|
226 |
+ } |
|
227 |
+ } |
|
228 |
+ } |
|
229 |
+ }, |
|
230 |
+ { |
|
231 |
+ "kind": "Service", |
|
232 |
+ "apiVersion": "v1", |
|
233 |
+ "metadata": { |
|
234 |
+ "name": "${DATABASE_SERVICE_NAME}", |
|
235 |
+ "annotations": { |
|
236 |
+ "description": "Exposes the database server" |
|
237 |
+ } |
|
238 |
+ }, |
|
239 |
+ "spec": { |
|
240 |
+ "ports": [ |
|
241 |
+ { |
|
242 |
+ "name": "postgresql", |
|
243 |
+ "port": 5432, |
|
244 |
+ "targetPort": 5432 |
|
245 |
+ } |
|
246 |
+ ], |
|
247 |
+ "selector": { |
|
248 |
+ "name": "${DATABASE_SERVICE_NAME}" |
|
249 |
+ } |
|
250 |
+ } |
|
251 |
+ }, |
|
252 |
+ { |
|
253 |
+ "kind": "DeploymentConfig", |
|
254 |
+ "apiVersion": "v1", |
|
255 |
+ "metadata": { |
|
256 |
+ "name": "${DATABASE_SERVICE_NAME}", |
|
257 |
+ "annotations": { |
|
258 |
+ "description": "Defines how to deploy the database" |
|
259 |
+ } |
|
260 |
+ }, |
|
261 |
+ "spec": { |
|
262 |
+ "strategy": { |
|
263 |
+ "type": "Recreate" |
|
264 |
+ }, |
|
265 |
+ "triggers": [ |
|
266 |
+ { |
|
267 |
+ "type": "ImageChange", |
|
268 |
+ "imageChangeParams": { |
|
269 |
+ "automatic": false, |
|
270 |
+ "containerNames": [ |
|
271 |
+ "postgresql" |
|
272 |
+ ], |
|
273 |
+ "from": { |
|
274 |
+ "kind": "ImageStreamTag", |
|
275 |
+ "namespace": "openshift", |
|
276 |
+ "name": "postgresql:9.4" |
|
277 |
+ } |
|
278 |
+ } |
|
279 |
+ }, |
|
280 |
+ { |
|
281 |
+ "type": "ConfigChange" |
|
282 |
+ } |
|
283 |
+ ], |
|
284 |
+ "replicas": 1, |
|
285 |
+ "selector": { |
|
286 |
+ "name": "${DATABASE_SERVICE_NAME}" |
|
287 |
+ }, |
|
288 |
+ "template": { |
|
289 |
+ "metadata": { |
|
290 |
+ "name": "${DATABASE_SERVICE_NAME}", |
|
291 |
+ "labels": { |
|
292 |
+ "name": "${DATABASE_SERVICE_NAME}" |
|
293 |
+ } |
|
294 |
+ }, |
|
295 |
+ "spec": { |
|
296 |
+ "containers": [ |
|
297 |
+ { |
|
298 |
+ "name": "postgresql", |
|
299 |
+ "image": "postgresql", |
|
300 |
+ "ports": [ |
|
301 |
+ { |
|
302 |
+ "containerPort": 5432 |
|
303 |
+ } |
|
304 |
+ ], |
|
305 |
+ "env": [ |
|
306 |
+ { |
|
307 |
+ "name": "POSTGRESQL_USER", |
|
308 |
+ "value": "${DATABASE_USER}" |
|
309 |
+ }, |
|
310 |
+ { |
|
311 |
+ "name": "POSTGRESQL_PASSWORD", |
|
312 |
+ "value": "${DATABASE_PASSWORD}" |
|
313 |
+ }, |
|
314 |
+ { |
|
315 |
+ "name": "POSTGRESQL_DATABASE", |
|
316 |
+ "value": "${DATABASE_NAME}" |
|
317 |
+ }, |
|
318 |
+ { |
|
319 |
+ "name": "POSTGRESQL_MAX_CONNECTIONS", |
|
320 |
+ "value": "${POSTGRESQL_MAX_CONNECTIONS}" |
|
321 |
+ }, |
|
322 |
+ { |
|
323 |
+ "name": "POSTGRESQL_SHARED_BUFFERS", |
|
324 |
+ "value": "${POSTGRESQL_SHARED_BUFFERS}" |
|
325 |
+ } |
|
326 |
+ ] |
|
327 |
+ } |
|
328 |
+ ] |
|
329 |
+ } |
|
330 |
+ } |
|
331 |
+ } |
|
332 |
+ } |
|
333 |
+ ], |
|
334 |
+ "parameters": [ |
|
335 |
+ { |
|
336 |
+ "name": "SOURCE_REPOSITORY_URL", |
|
337 |
+ "description": "The URL of the repository with your application source code", |
|
338 |
+ "value": "https://github.com/openshift/rails-ex.git" |
|
339 |
+ }, |
|
340 |
+ { |
|
341 |
+ "name": "SOURCE_REPOSITORY_REF", |
|
342 |
+ "description": "Set this to a branch name, tag or other ref of your repository if you are not using the default branch" |
|
343 |
+ }, |
|
344 |
+ { |
|
345 |
+ "name": "CONTEXT_DIR", |
|
346 |
+ "description": "Set this to the relative path to your project if it is not in the root of your repository" |
|
347 |
+ }, |
|
348 |
+ { |
|
349 |
+ "name": "APPLICATION_DOMAIN", |
|
350 |
+ "description": "The exposed hostname that will route to the Rails service, if left blank a value will be defaulted.", |
|
351 |
+ "value": "" |
|
352 |
+ }, |
|
353 |
+ { |
|
354 |
+ "name": "GITHUB_WEBHOOK_SECRET", |
|
355 |
+ "description": "A secret string used to configure the GitHub webhook", |
|
356 |
+ "generate": "expression", |
|
357 |
+ "from": "[a-zA-Z0-9]{40}" |
|
358 |
+ }, |
|
359 |
+ { |
|
360 |
+ "name": "SECRET_KEY_BASE", |
|
361 |
+ "description": "Your secret key for verifying the integrity of signed cookies", |
|
362 |
+ "generate": "expression", |
|
363 |
+ "from": "[a-z0-9]{127}" |
|
364 |
+ }, |
|
365 |
+ { |
|
366 |
+ "name": "APPLICATION_USER", |
|
367 |
+ "description": "The application user that is used within the sample application to authorize access on pages", |
|
368 |
+ "value": "openshift" |
|
369 |
+ }, |
|
370 |
+ { |
|
371 |
+ "name": "APPLICATION_PASSWORD", |
|
372 |
+ "description": "The application password that is used within the sample application to authorize access on pages", |
|
373 |
+ "value": "secret" |
|
374 |
+ }, |
|
375 |
+ { |
|
376 |
+ "name": "RAILS_ENV", |
|
377 |
+ "description": "Environment under which the sample application will run. Could be set to production, development or test", |
|
378 |
+ "value": "production" |
|
379 |
+ }, |
|
380 |
+ { |
|
381 |
+ "name": "DATABASE_SERVICE_NAME", |
|
382 |
+ "description": "Database service name", |
|
383 |
+ "value": "postgresql" |
|
384 |
+ }, |
|
385 |
+ { |
|
386 |
+ "name": "DATABASE_USER", |
|
387 |
+ "description": "database username", |
|
388 |
+ "generate": "expression", |
|
389 |
+ "from": "user[A-Z0-9]{3}" |
|
390 |
+ }, |
|
391 |
+ { |
|
392 |
+ "name": "DATABASE_PASSWORD", |
|
393 |
+ "description": "database password", |
|
394 |
+ "generate": "expression", |
|
395 |
+ "from": "[a-zA-Z0-9]{8}" |
|
396 |
+ }, |
|
397 |
+ { |
|
398 |
+ "name": "DATABASE_NAME", |
|
399 |
+ "description": "database name", |
|
400 |
+ "value": "root" |
|
401 |
+ }, |
|
402 |
+ { |
|
403 |
+ "name": "POSTGRESQL_MAX_CONNECTIONS", |
|
404 |
+ "description": "database max connections", |
|
405 |
+ "value": "100" |
|
406 |
+ }, |
|
407 |
+ { |
|
408 |
+ "name": "POSTGRESQL_SHARED_BUFFERS", |
|
409 |
+ "description": "database shared buffers", |
|
410 |
+ "value": "12MB" |
|
411 |
+ } |
|
412 |
+ ] |
|
413 |
+} |
0 | 414 |
new file mode 100755 |
... | ... |
@@ -0,0 +1,16 @@ |
0 |
+#!/bin/sh |
|
1 |
+# This script pulls down example files (eg templates) from external repositories |
|
2 |
+# so they can be included directly in our repository. |
|
3 |
+# Feeds off a README.md file with well defined syntax that informs this |
|
4 |
+# script how to pull the file down. |
|
5 |
+ |
|
6 |
+# For now the only external examples are in examples/quickstarts. |
|
7 |
+pushd examples/quickstarts |
|
8 |
+rm *json |
|
9 |
+rm *yaml |
|
10 |
+# Assume the README.md file contains lines with URLs for the raw json/yaml file to be downloaded. |
|
11 |
+# Specifically look for a line containing https://raw.githubusercontent.com, then |
|
12 |
+# look for the first content in ()s on that line, which will be the actual url of the file, |
|
13 |
+# then use curl to pull that file down. |
|
14 |
+curl `grep https://raw.githubusercontent.com README.md | sed -E "s/.*\((.*)\) -.*/\\1 -O/"` |
|
15 |
+popd |