Config
allows to specify default values and triggers to create a list
of PipelineRun
based
on InterceptorRequest
.
Config
supports supports the following fields:
defaults
- Specifies common default values for eachPipeline
.triggers
- Specifies a list ofTrigger
.
Sample config file:
defaults:
timeouts:
pipeline: 1h
tasks: 30m
finally: 10m
metadata:
namespace: tekton
annotations:
github.tekton.dev/owner: body.repository.owner.login
github.tekton.dev/repo: body.repository.name
github.tekton.dev/commit: >-
"pull_request" in body
? body.pull_request.head.sha
: body.head_commit.id
github.tekton.dev/url: >-
https://dashboard.tekton.dev/#/namespaces/{{ .Namespace }}/pipelineruns/{{ index .Labels "tekton.dev/pipelineRun" }}?pipelineTask={{ index .Labels "tekton.dev/pipelineTask" }}
github.tekton.dev/name: >-
{{ index .Labels "tekton.dev/pipeline" }} / {{ index .Labels "tekton.dev/pipelineTask" }}
params:
- name: clone-url
value: body.repository.clone_url
- name: clone-ref
value: >-
"pull_request" in body
? body.pull_request.head.sha
: body.head_commit.id
- name: repo-name
value: body.repository.name
- name: repo-owner-name
value: body.repository.owner.login
workspaces:
- name: source
volumeClaimTemplate:
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 5Gi
storageClassName: <Storage Class Name>
- name: cache
persistentVolumeClaim:
claimName: <PVC name>
podTemplate:
tolerations:
- effect: NoSchedule
key: tekton-pipelines
operator: Equal
value: "true"
nodeSelector:
node_pool: tekton-pipelines
triggers:
- name: pr
filter: >-
"action" in body && body.action in ["opened", "synchronize", "reopened"]
pipelines: [ ]
defaults:
params: [ ]
- name: main
filter: >-
"ref" in body && body.ref == "refs/heads/main"
pipelines: [ ]
defaults:
params: [ ]
- name: tag
filter: >-
"ref" in body && body.ref.startsWith("refs/tags/")
defaults:
params: [ ]
Defaults
definition contains all Pipeline
fields except name
.
Each Triggers
definition supports the following fields:
name
- Specifies a name of current trigger.filter
- Specifies CEL expression which helps to filter out triggers based onInterceptorRequest
.pipelines
- Specifies a list ofPipeline
.defaults
- Specifies default values for eachPipeline
.
Pipeline
definition supports the following fields:
*
- allPipelineRunSpec
fields.name
- Specifies a name of current pipeline.metadata
- Specifiesmetadata
that uniquely identifies pipeline, eg.annotations
.
triggers:
- name: pr
pipelines:
- name: buf
pipelineRef:
resolver: git
params:
- name: repo
value: tekton-catalog-new
- name: pathInRepo
value: pipeline/protos/0.3/buf.yaml
taskRunSpecs:
- pipelineTaskName: lint
computeResources:
requests:
memory: 1Gi
cpu: '1'
limits:
memory: 1Gi
cpu: '1'
- pipelineTaskName: svu
stepSpecs:
- name: svu
computeResources:
requests:
memory: 1.2Gi
cpu: '1.2'
limits:
memory: 1.2Gi
cpu: '1.2'