1
0
mirror of https://github.com/openshift/openshift-docs.git synced 2026-02-05 12:46:18 +01:00
Files
openshift-docs/modules/applications-create-using-cli-template.adoc
Preeti 3f80e97d03 docs_for_developer_console
updating_topic_map_and_images

fixed_attribute_error

fixed_context_error

modified_topic_map

Fixed review comments

fixes_review_comments

fixed_ID

removed_xrefs_from_modules

moodified_images_removed_links_from_modules_added_xrefs_to_assemblies

fixed_xref

fixing_xref_issues

fixing_xrefs

fixing_links

fixing_link

fixed_id

modify_link

modifying_link

adding_anchor_ids
2019-09-30 18:59:30 +00:00

48 lines
1.5 KiB
Plaintext

// Module included in the following assemblies:
//
// * applications/application-life-cycle-management/creating-applications-using-the-cli.adoc
[id="applications-create-using-cli-template_{context}"]
= Creating an application from a template
You can create an application from a previously stored template or from a
template file, by specifying the name of the template as an argument. For
example, you can store a sample application template and use it to create an
application.
Create an application from a stored template, for example:
----
$ oc create -f examples/sample-app/application-template-stibuild.json
$ oc new-app ruby-helloworld-sample
----
To directly use a template in your local file system, without first storing it
in {product-title}, use the `-f|--file` argument. For example:
----
$ oc new-app -f examples/sample-app/application-template-stibuild.json
----
== Template Parameters
When creating an application based on a template, use the
`-p|--param` argument to set parameter values that are defined by the template:
----
$ oc new-app ruby-helloworld-sample \
-p ADMIN_USERNAME=admin -p ADMIN_PASSWORD=mypassword
----
You can store your parameters in a file, then use that 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=-
----