Setting up a Pipeline Template Catalog

1 minute read

Pipeline Template Catalogs are defined as catalog.yaml files, which are stored at the root of the source code repository.

An example Pipeline Template Catalog is available in the GitHub repository cloudbees/cloudbees-examples under the pipeline-template-examples directory.

To set up a repository for Pipeline Templates:

  1. Create a source code repository for the Catalog.

  2. Apply permissions settings to the repository to ensure that only approved authors of templates has write access.

This repository stores:

  • The catalog.yaml file containing the catalog description.

  • The templates folder containing the different templates shipped with the catalog.

  • One folder for each Pipeline template within the templates folder.

  • One Jenkinsfile and a template.yaml files in each one of the templates folder.

Samples of a Pipeline Template Catalog structure
/<repository> ├── catalog.yaml └── templates └── template1 ├── Jenkinsfile └── template.yaml └── template2 ├── Jenkinsfile └── template.yaml └── template3 ├── Jenkinsfile └── template.yaml

To set up a Pipeline Template Catalog, create a catalog.yaml file:

  1. Using the text editor of your choice, create a blank file.

  2. Populate the file with the appropriate values.

  3. Save the file as catalog.yaml.

  4. Commit the file to the root of your source code repository.

Understanding catalog.yaml parameters

The table below provides the details of the parameters available in the catalog.yaml file.

Parameter Description Required?

displayName

The name to be shown in the CloudBees CI user interface.

Yes

name

The unique identifier for the catalog.

Yes

type

The definition of the catalog YAML syntax. Must be: type: pipeline-template-catalog.

Yes

version

The version of the catalog YAML syntax.

Yes

Example catalog.yaml file

This example is from catalog.yaml:

version: 1 type: pipeline-template-catalog name: customerPortalFrontendTeamCatalog displayName: Shared Template Catalog for Teams Working on the Customer Portal