File tree 2 files changed +58
-3
lines changed
2 files changed +58
-3
lines changed Original file line number Diff line number Diff line change @@ -275,6 +275,20 @@ $ oc new-app ruby-helloworld-sample \
275
275
----
276
276
====
277
277
278
+ You can store your parameters in a file and then use this file with
279
+ `--param-file` when instantiating a template. If you want to read the
280
+ parameters from standard input, use `--param-file=-`:
281
+
282
+ ====
283
+ ----
284
+ $ cat helloworld.params
285
+ ADMIN_USERNAME=admin
286
+ ADMIN_PASSWORD=mypassword
287
+ $ oc new-app ruby-helloworld-sample --param-file=helloworld.params
288
+ $ cat helloworld.params | oc new-app ruby-helloworld-sample --param-file=-
289
+ ----
290
+ ====
291
+
278
292
[[new-app-output]]
279
293
280
294
=== Further Modifying Application Creation
@@ -342,10 +356,30 @@ $ oc new-app openshift/postgresql-92-centos7 \
342
356
----
343
357
====
344
358
359
+ The variables can also be read from file using the `--env-file` argument:
360
+
361
+ ====
362
+ ----
363
+ $ cat postgresql.env
364
+ POSTGRESQL_USER=user
365
+ POSTGRESQL_DATABASE=db
366
+ POSTGRESQL_PASSWORD=password
367
+ $ oc new-app openshift/postgresql-92-centos7 --env-file=postgresql.env
368
+ ----
369
+ ====
370
+
371
+ Additionally, environment variables can be given on standard input by using
372
+ `--env-file=-`:
373
+ ====
374
+ ----
375
+ $ cat postgresql.env | oc new-app openshift/postgresql-92-centos7 --env-file=-
376
+ ----
377
+ ====
378
+
345
379
[NOTE]
346
380
====
347
381
Any `*BuildConfig*` objects created as part of `new-app` processing will not be updated with
348
- environment variables passed via the `-e|--env` argument.
382
+ environment variables passed via the `-e|--env` or `--env-file` argument.
349
383
====
350
384
351
385
Original file line number Diff line number Diff line change @@ -190,7 +190,7 @@ $ oc process <template> | oc create -f -
190
190
191
191
You can override any
192
192
xref:../dev_guide/templates.adoc#templates-parameters[parameter] values defined
193
- in the file by adding the `-v ` option for each `<name>=<value>` pair you want
193
+ in the file by adding the `-p ` option for each `<name>=<value>` pair you want
194
194
to override. A parameter reference may appear in any text field inside the
195
195
template items.
196
196
@@ -215,11 +215,32 @@ command:
215
215
----
216
216
$ oc process -f my-rails-postgresql \
217
217
-p POSTGRESQL_USER=bob \
218
- -P POSTGRESQL_DATABASE=mydatabase \
218
+ -p POSTGRESQL_DATABASE=mydatabase \
219
219
| oc create -f -
220
220
----
221
221
====
222
222
223
+ If you have large number of parameters you might prefer to store them in a file
224
+ and then pass this file to `oc process`:
225
+
226
+ ====
227
+ ----
228
+ $ cat postgres.env
229
+ POSTGRESQL_USER=bob
230
+ POSTGRESQL_DATABASE=mydatabase
231
+ $ oc process -f my-rails-postgresql --param-file=postgres.env
232
+ ----
233
+ ====
234
+
235
+ You can also read the environment from standard input by using `"-"` as the
236
+ argument to `--param-file`:
237
+
238
+ ====
239
+ ----
240
+ $ sed s/bob/alice/ postgres.env | oc process -f my-rails-postgresql --param-file=-
241
+ ----
242
+ ====
243
+
223
244
[[modifying-an-uploaded-template]]
224
245
225
246
== Modifying an Uploaded Template
You can’t perform that action at this time.
0 commit comments