Components are a new way to offer reusable jobs
They are similar to job templates…
…but more contained, i.e. they cannot be overwritten
Directory layout for component called go
:
templates/go.yml
templates/go/template.yml
Components require a header with spec
and body:
spec:
input:
path:
type: string
description: "Path to the source code"
---
job:
script: go build $[[ inputs.path ]]
The body can also contain job templates
Both are reusable
Templates are fragments of a job
Components are self-contained jobs
Templates can be overwridden
Components require inputs declarations
Both are reusable
Templates require variables
Components define inputs
Templates require a special syntax for include
Components must be digest/version pinned
CI/CD Catalog is a collection of components
Instance-wide catalog
Components can be used without the catalog
Project owners can switch to catalog project
See chapter CI/CD Components