In a pipeline that instantiates a template, besides providing values for template variables you can…
Inherit from the template
By default, the pipeline instance inherits from
pipeline.stages only. The
pipeline does not inherit any other items defined in the template. You have to
explicitly identify anything else from the template you want to inherit.
For example, the template might have a trigger defined in the
triggers element, but that trigger is not used in your pipeline unless you
triggers inside the
In the pipeline template you are instantiating, examine what’s in the
pipelineelement to see what you want to use in your pipeline.
spin pipeline-template get --id <templateName>
inherit: section of the pipeline JSON, include the key for each element of the template that you want to inherit.
For example, to inherit triggers defined in
inheritelement of the new pipeline:
The same goes for anything else found inside
"inherit": ["triggers", "notifications"] # for example
Now, all the triggers and notificatons (in this example) defined in the template are part of the pipeline instance.
Override the template
To override an element from a pipeline template is to add to that element. You can only override an element if you inherit it, and you can only add to it—you can’t remove or edit individual members.
The stage definitions inside
stages are inherited by default. You can add
further stages, and the configuration required to wire added stages with
Make sure you’re inheriting from the element or elements you want to override.
Also, as mentioned above, stages defined in the tempate are inherited by default.
Add any triggers, notifications, parameters, etc., inside their respective elements.
These items are now added to those inherited from the template.