Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 35 additions & 1 deletion dev_guide/application_lifecycle/new_app.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,20 @@ $ oc new-app ruby-helloworld-sample \
----
====

You can store your parameters in a file and then use this file with
`--param-file` when instantiating a template. If you want to read the
parameters from standard input, use `--param-file=-`:

====
----
$ cat helloworld.params
ADMIN_USERNAME=admin
ADMIN_PASSWORD=mypassword
$ oc new-app ruby-helloworld-sample --param-file=helloworld.params
$ cat helloworld.params | oc new-app ruby-helloworld-sample --param-file=-
----
====

[[new-app-output]]

=== Further Modifying Application Creation
Expand Down Expand Up @@ -342,10 +356,30 @@ $ oc new-app openshift/postgresql-92-centos7 \
----
====

The variables can also be read from file using the `--env-file` argument:

====
----
$ cat postgresql.env
POSTGRESQL_USER=user
POSTGRESQL_DATABASE=db
POSTGRESQL_PASSWORD=password
$ oc new-app openshift/postgresql-92-centos7 --env-file=postgresql.env
----
====

Additionally, environment variables can be given on standard input by using
`--env-file=-`:
====
----
$ cat postgresql.env | oc new-app openshift/postgresql-92-centos7 --env-file=-
----
====

[NOTE]
====
Any `*BuildConfig*` objects created as part of `new-app` processing will not be updated with
environment variables passed via the `-e|--env` argument.
environment variables passed via the `-e|--env` or `--env-file` argument.
====


Expand Down
25 changes: 23 additions & 2 deletions dev_guide/templates.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ $ oc process <template> | oc create -f -

You can override any
xref:../dev_guide/templates.adoc#templates-parameters[parameter] values defined
in the file by adding the `-v` option for each `<name>=<value>` pair you want
in the file by adding the `-p` option for each `<name>=<value>` pair you want
to override. A parameter reference may appear in any text field inside the
template items.

Expand All @@ -215,11 +215,32 @@ command:
----
$ oc process -f my-rails-postgresql \
-p POSTGRESQL_USER=bob \
-P POSTGRESQL_DATABASE=mydatabase \
-p POSTGRESQL_DATABASE=mydatabase \
| oc create -f -
----
====

If you have large number of parameters you might prefer to store them in a file
and then pass this file to `oc process`:

====
----
$ cat postgres.env
POSTGRESQL_USER=bob
POSTGRESQL_DATABASE=mydatabase
$ oc process -f my-rails-postgresql --param-file=postgres.env
----
====

You can also read the environment from standard input by using `"-"` as the
argument to `--param-file`:

====
----
$ sed s/bob/alice/ postgres.env | oc process -f my-rails-postgresql --param-file=-
----
====

[[modifying-an-uploaded-template]]

== Modifying an Uploaded Template
Expand Down