From 68cc5f911018430967cac7bb566a0982d557553d Mon Sep 17 00:00:00 2001 From: ericzzzzzzz <102683393+ericzzzzzzz@users.noreply.github.com> Date: Wed, 5 Jul 2023 11:48:44 -0400 Subject: [PATCH] docs: document cmd template function (#8929) --- docs-v2/content/en/docs/environment/templating.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/docs-v2/content/en/docs/environment/templating.md b/docs-v2/content/en/docs/environment/templating.md index c78308d5db0..ba8b945089f 100644 --- a/docs-v2/content/en/docs/environment/templating.md +++ b/docs-v2/content/en/docs/environment/templating.md @@ -43,4 +43,7 @@ List of variables that are available for templating: * `IMAGE_NAME2`, `IMAGE_REPO2`, `IMAGE_TAG2`, `IMAGE_DIGEST2` - the 2nd artifact's image name, tag, and sha256 digest * `IMAGE_NAME2`, `IMAGE_REPON`, `IMAGE_TAGN`, `IMAGE_DIGESTN` - the Nth artifact's image name, tag, and sha256 digest -Default values can be specified using the `{{default "bar" .FOO}}` expression syntax, which results in "bar" if .FOO is nil or a zero value. +### Template functions +Besides the [built-in template functions](https://pkg.go.dev/text/template) in golang, skaffold also provides the following ones: +- `default` : Default values can be specified using the `{{default "bar" .FOO}}` expression syntax, which results in "bar" if .FOO is nil or a zero value. +- `cmd`: This allows users to use the result from external commands in template, for example `{{cmd "bash" "-c" "xxx xxx xxx"}}` can be used to execute bash script and get the result into the template.