Skip to main content
A Pipeline is a collection of Tasks arranged in a specific order of execution. Pipelines express how outputs of tasks feed into inputs of subsequent tasks.

Resource Definition

apiVersion
string
required
tekton.dev/v1
kind
string
required
Pipeline
metadata
ObjectMeta
required
Standard Kubernetes metadata.
spec
PipelineSpec
required
Defines the desired state of the Pipeline.

PipelineSpec

description
string
A user-facing description of the pipeline.
displayName
string
A user-facing name of the pipeline that may be used to populate a UI.
params
[]ParamSpec
Parameters that must be supplied when running the Pipeline.See Parameter Types for details.
tasks
[]PipelineTask
required
The graph of Tasks that execute when this Pipeline runs.
finally
[]PipelineTask
Tasks that execute after all pipeline tasks finish, regardless of success or failure.
workspaces
[]PipelineWorkspaceDeclaration
Workspaces expected to be provided by a PipelineRun.
results
[]PipelineResult
Values that this pipeline can output.

Example

apiVersion: tekton.dev/v1
kind: Pipeline
metadata:
  name: example-pipeline
spec:
  description: "An example pipeline"
  params:
    - name: repo-url
      type: string
  workspaces:
    - name: shared-data
  tasks:
    - name: fetch-source
      taskRef:
        name: git-clone
      params:
        - name: url
          value: $(params.repo-url)
      workspaces:
        - name: output
          workspace: shared-data
    - name: build
      taskRef:
        name: build-task
      runAfter:
        - fetch-source
      workspaces:
        - name: source
          workspace: shared-data
  finally:
    - name: cleanup
      taskRef:
        name: cleanup-task