Pipeline-as-code

2 minute read

Pipeline-as-code (PasC) is a practice of defining pipelines through source code which can be stored in a repository, such as GitHub, to manage changes. CloudBees Release Orchestration SaaS provides this feature for you to define pipelines in YAML format, store the files in a repository, and synchronize your pipelines.

To configure a GitHub repository for pipelines, refer to Uploading SasC files with Git.

Alternatively, you can define pipelines in Pipeline composer with the YAML editor without a Git repository. However, all pipelines synchronized from GitHub are displayed in the YAML editor in read-only mode.

Using a PasC template

To use a PasC template to define a pipeline:

  1. From the CloudBees Release Orchestration SaaS Home page, select Orchestration  Pipeline composer.

  2. Select Templates on the left pane.

  3. Select a template.

  4. Select the Download icon to download the PasC template in YAML format.

  5. Define the downloaded template using the YAML file comments as a guide.

You must enter a Pipeline name, Application, Module, and Component. A component name can be associated with only one pipeline.
Download template
Figure 1. The template list with the download icon highlighted on the selected template.
  1. Check in the updated YAML file to the pipelines folder of your configured GitHub repository and branch.

  2. Verify the updates to the pipeline.

    Successful sync
    Figure 2. An example of a successful sync, with YAML validation highlighted.
    • Synchronization is initiated in less than a minute after a code check-in.

    • All pipelines synced from the repository are displayed in read-only view.

    • On successful synchronization, the pipeline is updated and enabled.

    • Any errors in the pipeline definition or processing are displayed.

    • The pipelines can be enabled, disabled, or deleted from Pipeline composer.

  3. Select the code to view.

Your PasC template is used to define a pipeline.

Code display
Figure 3. The code is displayed on the right pane.