CI/CD Components


CI/CD Components

Components are a new way to offer reusable jobs

They are similar to job templates…

…but more contained, i.e. they cannot be overwritten


Authoring

Directory layout for component called go:

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


Components vs. Templates 1/2

Both are reusable

Anatomy

Templates are fragments of a job

Components are self-contained jobs

Composability

Templates can be overwridden

Components require inputs declarations


Components vs. Templates 2/2

Both are reusable

Parameters

Templates require variables

Components define inputs

Versioning

Templates require a special syntax for include

Components must be digest/version pinned


CI/CD Catalog

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


Hands-On

See chapter CI/CD Components