Skip to content

Commit c20d087

Browse files
authored
Merge pull request #37675 from rh-max/srvls-kn-func-registry
SRVOCF-365: Document the -r <repository> option of the `kn func create` command
2 parents 2aae4d0 + 268f2a5 commit c20d087

File tree

1 file changed

+20
-2
lines changed

1 file changed

+20
-2
lines changed

modules/serverless-create-func-kn.adoc

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@
33

44
You can create a basic serverless function using the `kn` CLI.
55

6-
You can specify the path, runtime, and template as flags on the command line, or use the `-c` flag to start the interactive experience in the terminal.
6+
You can specify the path, runtime, template, and repository with the template as flags on the command line, or use the `-c` flag to start the interactive experience in the terminal.
77

88
.Procedure
99

1010
* Create a function project:
1111
+
1212
[source,terminal]
1313
----
14-
$ kn func create <path> -l <runtime> -t <template>
14+
$ kn func create -r <repository> -l <runtime> -t <template> <path>
1515
----
1616
** Supported runtimes include `node`, `go`, `python`, `quarkus`, and `typescript`.
1717
** Supported templates include `http` and `events`.
@@ -31,3 +31,21 @@ Runtime: typescript
3131
Template: events
3232
Writing events to /home/user/demo/examplefunc
3333
----
34+
+
35+
** Alternatively, you can specify a repository that contains a custom template.
36+
+
37+
.Example command
38+
[source,terminal]
39+
----
40+
$ kn func create -r https://github.com/boson-project/templates/ -l node -t hello-world examplefunc
41+
----
42+
+
43+
.Example output
44+
[source,terminal]
45+
----
46+
Project path: /home/user/demo/examplefunc
47+
Function name: examplefunc
48+
Runtime: node
49+
Template: hello-world
50+
Writing events to /home/user/demo/examplefunc
51+
----

0 commit comments

Comments
 (0)