mirror of
https://github.com/openshift/openshift-docs.git
synced 2026-02-05 21:46:22 +01:00
28 lines
949 B
Plaintext
28 lines
949 B
Plaintext
// Module included in the following assemblies:
|
|
//
|
|
// * openshift_images/using-templates.adoc
|
|
|
|
:_content-type: PROCEDURE
|
|
[id="templates-uploading_{context}"]
|
|
= Uploading a template
|
|
|
|
If you have a JSON or YAML file that defines a template, for example as seen in this example, you can upload the template to projects using the CLI. This saves the template to the project for repeated use by any user with appropriate access to that project. Instructions on writing your own templates are provided later in this topic.
|
|
|
|
.Procedure
|
|
|
|
* Upload a template to your current project's template library, pass the JSON or YAML file with the following command:
|
|
+
|
|
[source,terminal]
|
|
----
|
|
$ oc create -f <filename>
|
|
----
|
|
|
|
* Upload a template to a different project using the `-n` option with the name of the project:
|
|
+
|
|
[source,terminal]
|
|
----
|
|
$ oc create -f <filename> -n <project>
|
|
----
|
|
|
|
The template is now available for selection using the web console or the CLI.
|