From 9d8e7dafceafb8a4cdfcbc1beeeb1e3fb26cce56 Mon Sep 17 00:00:00 2001 From: Kyle Lape Date: Fri, 15 Nov 2024 09:40:49 -0600 Subject: [PATCH] ROX-26784: Configure tekton pipelines for release branch (#1703) Which Konflux events will trigger builds: * Pushes: Target branch is release-* or any tag * PRs: all --- .tekton/scanner-build.yaml | 13 ++++++++----- .tekton/scanner-db-build.yaml | 13 ++++++++----- .tekton/scanner-db-slim-build.yaml | 13 ++++++++----- .tekton/scanner-slim-build.yaml | 13 ++++++++----- 4 files changed, 32 insertions(+), 20 deletions(-) diff --git a/.tekton/scanner-build.yaml b/.tekton/scanner-build.yaml index e8ee505e0..f4ac12576 100644 --- a/.tekton/scanner-build.yaml +++ b/.tekton/scanner-build.yaml @@ -8,13 +8,16 @@ metadata: build.appstudio.redhat.com/pull_request_number: '{{pull_request_number}}' build.appstudio.redhat.com/target_branch: '{{target_branch}}' pipelinesascode.tekton.dev/max-keep-runs: "500" - # TODO(ROX-21073): re-enable for all PR branches pipelinesascode.tekton.dev/on-cel-expression: | - (event == "push" && target_branch.matches("^(master|release-.*)$")) || - (event == "pull_request" && (source_branch.matches("(konflux|appstudio|rhtap)") || body.pull_request.labels.exists(l, l.name == "konflux-build"))) + event == "pull_request" || ( + event == "push" && ( + source_branch.startsWith("release-") || + target_branch.startsWith("refs/tags/") + ) + ) labels: - appstudio.openshift.io/application: acs - appstudio.openshift.io/component: scanner + appstudio.openshift.io/application: acs-4-6 + appstudio.openshift.io/component: scanner-4-6 pipelines.appstudio.openshift.io/type: build name: scanner-build namespace: rh-acs-tenant diff --git a/.tekton/scanner-db-build.yaml b/.tekton/scanner-db-build.yaml index 88398a330..cb7d51781 100644 --- a/.tekton/scanner-db-build.yaml +++ b/.tekton/scanner-db-build.yaml @@ -8,13 +8,16 @@ metadata: build.appstudio.redhat.com/pull_request_number: '{{pull_request_number}}' build.appstudio.redhat.com/target_branch: '{{target_branch}}' pipelinesascode.tekton.dev/max-keep-runs: "500" - # TODO(ROX-21073): re-enable for all PR branches pipelinesascode.tekton.dev/on-cel-expression: | - (event == "push" && target_branch.matches("^(master|release-.*)$")) || - (event == "pull_request" && (source_branch.matches("(konflux|appstudio|rhtap)") || body.pull_request.labels.exists(l, l.name == "konflux-build"))) + event == "pull_request" || ( + event == "push" && ( + source_branch.startsWith("release-") || + target_branch.startsWith("refs/tags/") + ) + ) labels: - appstudio.openshift.io/application: acs - appstudio.openshift.io/component: scanner-db + appstudio.openshift.io/application: acs-4-6 + appstudio.openshift.io/component: scanner-db-4-6 pipelines.appstudio.openshift.io/type: build name: scanner-db-build namespace: rh-acs-tenant diff --git a/.tekton/scanner-db-slim-build.yaml b/.tekton/scanner-db-slim-build.yaml index 7c557904c..7ed1c7eae 100644 --- a/.tekton/scanner-db-slim-build.yaml +++ b/.tekton/scanner-db-slim-build.yaml @@ -8,13 +8,16 @@ metadata: build.appstudio.redhat.com/pull_request_number: '{{pull_request_number}}' build.appstudio.redhat.com/target_branch: '{{target_branch}}' pipelinesascode.tekton.dev/max-keep-runs: "500" - # TODO(ROX-21073): re-enable for all PR branches pipelinesascode.tekton.dev/on-cel-expression: | - (event == "push" && target_branch.matches("^(master|release-.*)$")) || - (event == "pull_request" && (source_branch.matches("(konflux|appstudio|rhtap)") || body.pull_request.labels.exists(l, l.name == "konflux-build"))) + event == "pull_request" || ( + event == "push" && ( + source_branch.startsWith("release-") || + target_branch.startsWith("refs/tags/") + ) + ) labels: - appstudio.openshift.io/application: acs - appstudio.openshift.io/component: scanner-db-slim + appstudio.openshift.io/application: acs-4-6 + appstudio.openshift.io/component: scanner-db-slim-4-6 pipelines.appstudio.openshift.io/type: build name: scanner-db-slim-build namespace: rh-acs-tenant diff --git a/.tekton/scanner-slim-build.yaml b/.tekton/scanner-slim-build.yaml index f3a65786a..b922e8b25 100644 --- a/.tekton/scanner-slim-build.yaml +++ b/.tekton/scanner-slim-build.yaml @@ -8,13 +8,16 @@ metadata: build.appstudio.redhat.com/pull_request_number: '{{pull_request_number}}' build.appstudio.redhat.com/target_branch: '{{target_branch}}' pipelinesascode.tekton.dev/max-keep-runs: "500" - # TODO(ROX-21073): re-enable for all PR branches pipelinesascode.tekton.dev/on-cel-expression: | - (event == "push" && target_branch.matches("^(master|release-.*)$")) || - (event == "pull_request" && (source_branch.matches("(konflux|appstudio|rhtap)") || body.pull_request.labels.exists(l, l.name == "konflux-build"))) + event == "pull_request" || ( + event == "push" && ( + target_branch.startsWith("release-") || + target_branch.startsWith("refs/tags/") + ) + ) labels: - appstudio.openshift.io/application: acs - appstudio.openshift.io/component: scanner-slim + appstudio.openshift.io/application: acs-4-6 + appstudio.openshift.io/component: scanner-slim-4-6 pipelines.appstudio.openshift.io/type: build name: scanner-slim-build namespace: rh-acs-tenant