Skip to content

Commit

Permalink
tekton: update cel expressions to avoid build loops
Browse files Browse the repository at this point in the history
- When bundle files change, build the bundle.
- Otherwise, build the operator.

The components relationship on Konflux are configured so that,
when the operator changes, a successful operator build will trigger
a pull request to update the image references in the bundle.
That in turn will trigger a bundle build.
See https://konflux-ci.dev/docs/how-tos/configuring/component-nudges/.

We should avoid changing both the operator and the bundle at the same time.
  • Loading branch information
spotlesstofu committed Jul 16, 2024
1 parent b2329eb commit 3a84bc0
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .tekton/trustee-operator-bundle-pull-request.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ metadata:
build.appstudio.redhat.com/target_branch: '{{target_branch}}'
pipelinesascode.tekton.dev/max-keep-runs: "3"
pipelinesascode.tekton.dev/on-cel-expression: event == "pull_request" && target_branch
== "main"
== "main" && "bundle*".pathChanged()
creationTimestamp: null
labels:
appstudio.openshift.io/application: trustee
Expand Down
2 changes: 1 addition & 1 deletion .tekton/trustee-operator-bundle-push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ metadata:
build.appstudio.redhat.com/target_branch: '{{target_branch}}'
pipelinesascode.tekton.dev/max-keep-runs: "3"
pipelinesascode.tekton.dev/on-cel-expression: event == "push" && target_branch
== "main"
== "main" && "bundle*".pathChanged()
creationTimestamp: null
labels:
appstudio.openshift.io/application: trustee
Expand Down
2 changes: 1 addition & 1 deletion .tekton/trustee-operator-pull-request.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ metadata:
build.appstudio.redhat.com/target_branch: '{{target_branch}}'
pipelinesascode.tekton.dev/max-keep-runs: "3"
pipelinesascode.tekton.dev/on-cel-expression: event == "pull_request" && target_branch
== "main"
== "main" && ! "bundle*".pathChanged()
creationTimestamp: null
labels:
appstudio.openshift.io/application: trustee
Expand Down
2 changes: 1 addition & 1 deletion .tekton/trustee-operator-push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ metadata:
build.appstudio.redhat.com/target_branch: '{{target_branch}}'
pipelinesascode.tekton.dev/max-keep-runs: "3"
pipelinesascode.tekton.dev/on-cel-expression: event == "push" && target_branch
== "main"
== "main" && ! "bundle*".pathChanged()
creationTimestamp: null
labels:
appstudio.openshift.io/application: trustee
Expand Down

0 comments on commit 3a84bc0

Please sign in to comment.