Specifying remote pipelines using hub resolvers

Feature Overview

Pipelines are reusable blocks for your CI/CD processes. When creating a pipeline run, you can specify a remote pipeline from the Catalog available on DevOps Hub. ACP DevOps serves the built-in Hub catalog through artifacthub-shim.

Steps

1. Select a Pipeline

Here is the pipelines available on Hub:

  • java-image-build-scan-deploy
  • python-image-build-scan-deploy

2. Specifying the remote task using the hub resolver

To specify a remote pipeline, use the following reference format in the pipelineRef:

# ...
spec:
  pipelineRef:
    resolver: hub
    params:
    - name: type
      value: artifact
    - name: catalog
      value: catalog-pipelines
    - name: kind
      value: pipeline
    - name: name
      value: <resource_name>
    - name: version
      value: "<resource_version>"
# ...
ParameterDescriptionExample value
typeHub backend type. Use artifact for artifacthub-shim.artifact
catalogThe catalog for pulling the resource. Use catalog-pipelines for built-in Pipelines.catalog-pipelines
kindEither task or pipeline.pipeline
nameThe name of the task or pipeline to fetch from the hub.java-image-build-scan-deploy
versionThe version of the task or pipeline to fetch from the hub. You must use quotes (") around the number."0.1"

If the pipeline requires additional parameters, specify values for these parameters in the params section of the specification of the pipeline run. The params section of the pipelineRef specification must contain only the parameters that the resolver supports.

Examples:

The following example pipeline run references a remote pipeline from the catalog:

apiVersion: tekton.dev/v1
kind: PipelineRun
metadata:
  name: hub-pipeline-reference-demo
spec:
  pipelineRef:
    resolver: hub
    params:
    - name: type
      value: artifact
    - name: catalog
      value: catalog-pipelines
    - name: kind
      value: pipeline
    - name: name
      value: java-image-build-scan-deploy
    - name: version
      value: "0.1"
  params:
  - name: sample-pipeline-parameter
    value: test

Learn More