Templating a Single Pipeline
The smallest ytt setup: one template file describing the shape of a pipeline, and one data values file supplying
the parts that change. Render them together, and you get a plain pipeline YAML file, ready for fly set-pipeline.
The Files
template.yml — the pipeline's shape, with #@ markers where values get substituted in:
vars.yml — the data values referenced above, marked with #@data/values so ytt knows to load them as inputs
rather than treat them as a second template:
Rendering
With both files in the same directory, either of these produce the same output:
# explicit files
ytt -f template.yml -f vars.yml > rendered.yml
# everything in the current directory
ytt -f . > rendered.yml
This is what gets rendered:
Setting the Pipeline
Treat rendered.yml like any other pipeline file:
Or, to render and set it in one motion from inside a pipeline, do the rendering in a task and feed the output straight
into a set_pipeline step: