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:
-
Create a source code repository for the Catalog.
-
Apply permissions settings to the repository to ensure that only approved authors of templates has write access.
This repository stores:
-
The
catalog.yamlfile containing the catalog description. -
The
templatesfolder containing the different templates shipped with the catalog. -
One folder for each Pipeline template within the
templatesfolder. -
One
Jenkinsfileand atemplate.yamlfiles in each one of the templates folder.
/<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:
-
Using the text editor of your choice, create a blank file.
-
Populate the file with the appropriate values.
-
Save the file as
catalog.yaml. -
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: |
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