vela def render
Render X-Definition.
Synopsis
Render X-Definition with CUE or Go format into kubernetes YAML format (default) or CUE format. Could be used to check whether the definition is working as expected. If a directory is used as input, all CUE and Go definitions in the directory will be rendered.
Go definitions use the defkit package to define components, traits, policies, and workflow steps in Go code. The Go file must import defkit and export functions that return definition types (e.g., *defkit.ComponentDefinition).
Use --format cue to output the raw CUE template instead of YAML. This is useful for inspecting the generated CUE from Go definitions.
vela def render DEFINITION.cue|DEFINITION.go [flags]
Examples
# Command below will render my-webservice.cue into YAML format and print it out.
> vela def render my-webservice.cue
# Command below will render a Go definition into YAML format.
> vela def render my-webservice.go
# Command below will render a Go definition into CUE format.
> vela def render my-webservice.go --format cue
# Command below will render my-webservice.cue and save it in my-webservice.yaml.
> vela def render my-webservice.cue -o my-webservice.yaml
# Command below will render all CUE and Go definitions in the ./defs/ directory and save the YAML objects in ./defs/yaml/.
> vela def render ./defs/ -o ./defs/yaml/
# Command below will render all CUE and Go definitions in ./defs/ and save CUE output in ./defs/cue/.
> vela def render ./defs/ -o ./defs/cue/ --format cue
Options
-f, --format string Specify the output format: 'yaml' (default) for Kubernetes YAML, or 'cue' for raw CUE template output. (default "yaml")
-h, --help help for render
--message string Specify the header message of the generated file. For example, declaring author information.
-o, --output string Specify the output path of the rendered definition. If empty, the definition will be printed in the console. If input is a directory, the output path is expected to be a directory as well.
Options inherited from parent commands
-V, --verbosity Level number for the log level verbosity
-y, --yes Assume yes for all user prompts
SEE ALSO
- vela def - Manage definitions.