Skip to content

Commit

Permalink
feat(dogfood): use cancel-in-progress/path-change
Browse files Browse the repository at this point in the history
Added `cancel-in-progress` annotation to multiple Tekton YAML files to
ensure that in-progress pipeline runs are canceled when new runs are
triggered. Use `on-path-change` and `on-target-event` annotations to as
well for path change.

Signed-off-by: Chmouel Boudjnah <[email protected]>
  • Loading branch information
chmouel committed Nov 25, 2024
1 parent 2f78eb8 commit 377e0ec
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 4 deletions.
5 changes: 3 additions & 2 deletions .tekton/doc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@ metadata:
annotations:
pipelinesascode.tekton.dev/task: "[git-clone]"
pipelinesascode.tekton.dev/max-keep-runs: "2"
pipelinesascode.tekton.dev/on-cel-expression: |
event == "pull_request" && "docs/***".pathChanged()
pipelinesascode.tekton.dev/cancel-in-progress: "true"
pipelinesascode.tekton.dev/on-target-event: "pull_request"
pipelinesascode.tekton.dev/on-path-change: "[docs/***]"
spec:
params:
- name: repo_url
Expand Down
1 change: 1 addition & 0 deletions .tekton/generate-coverage-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ metadata:
annotations:
pipelinesascode.tekton.dev/task: "[git-clone]"
pipelinesascode.tekton.dev/max-keep-runs: "2"
pipelinesascode.tekton.dev/cancel-in-progress: "true"
pipelinesascode.tekton.dev/on-cel-expression: |
event == "push" && target_branch == "main" && ("***/*.go".pathChanged() || "config/***".pathChanged() || ".tekton/generate-coverage-release.yaml".pathChanged())
spec:
Expand Down
5 changes: 3 additions & 2 deletions .tekton/go.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@ metadata:
annotations:
pipelinesascode.tekton.dev/task: "[git-clone]"
pipelinesascode.tekton.dev/max-keep-runs: "2"
pipelinesascode.tekton.dev/on-cel-expression: |
event == "pull_request" && "***/*.go".pathChanged()
pipelinesascode.tekton.dev/cancel-in-progress: "true"
pipelinesascode.tekton.dev/on-target-event: "pull_request"
pipelinesascode.tekton.dev/on-path-change: "[***/*.go]"
spec:
params:
- name: repo_url
Expand Down
1 change: 1 addition & 0 deletions .tekton/linter.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ metadata:
pipelinesascode.tekton.dev/on-event: "[push, pull_request]"
pipelinesascode.tekton.dev/on-target-branch: "[*]"
pipelinesascode.tekton.dev/max-keep-runs: "2"
pipelinesascode.tekton.dev/cancel-in-progress: "true"
pipelinesascode.tekton.dev/task: "[git-clone]"
spec:
params:
Expand Down
1 change: 1 addition & 0 deletions .tekton/release-pipeline.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ metadata:
pipelinesascode.tekton.dev/on-target-branch: "[refs/tags/*]"
pipelinesascode.tekton.dev/task: "[.tekton/tasks/goreleaser.yaml]"
pipelinesascode.tekton.dev/task-1: "[git-clone]"
pipelinesascode.tekton.dev/cancel-in-progress: "true"
pipelinesascode.tekton.dev/max-keep-runs: "2"
spec:
params:
Expand Down

0 comments on commit 377e0ec

Please sign in to comment.