Skip to content

Commit 46a5e6b

Browse files
ciaranRocheclaude
andcommitted
HYPERFLEET-924 - ci: replace pull-request pipeline with tag pipeline
Convert the Konflux pull-request pipeline to a tag pipeline that triggers on RC and release version tags. Prow owns PR validation, so the pull-request pipeline is not needed. - Rename pull-request.yaml to tag.yaml - CEL expression matches v* tags (RC and release) - Add extract-version task to strip refs/tags/v prefix - Inject VERSION build-arg into container build - Remove image expiry (tag images persist) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 8b0abf1 commit 46a5e6b

1 file changed

Lines changed: 36 additions & 8 deletions

File tree

Lines changed: 36 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,18 @@ metadata:
44
annotations:
55
build.appstudio.openshift.io/repo: https://github.com/openshift-hyperfleet/hyperfleet-api?rev={{revision}}
66
build.appstudio.redhat.com/commit_sha: '{{revision}}'
7-
build.appstudio.redhat.com/pull_request_number: '{{pull_request_number}}'
87
build.appstudio.redhat.com/target_branch: '{{target_branch}}'
9-
pipelinesascode.tekton.dev/cancel-in-progress: "true"
8+
pipelinesascode.tekton.dev/cancel-in-progress: "false"
109
pipelinesascode.tekton.dev/max-keep-runs: "3"
11-
pipelinesascode.tekton.dev/on-cel-expression: event == "pull_request" && target_branch
12-
== "main"
10+
pipelinesascode.tekton.dev/on-cel-expression: |
11+
event == "push"
12+
&& target_branch.matches("^refs/tags/v[0-9]+\\.[0-9]+\\.[0-9]+(-rc[0-9]+)?$")
1313
creationTimestamp: null
1414
labels:
1515
appstudio.openshift.io/application: hyperfleet
1616
appstudio.openshift.io/component: hyperfleet-api
1717
pipelines.appstudio.openshift.io/type: build
18-
name: hyperfleet-api-on-pull-request
18+
name: hyperfleet-api-on-tag
1919
namespace: hyperfleet-tenant
2020
spec:
2121
params:
@@ -24,9 +24,9 @@ spec:
2424
- name: revision
2525
value: '{{revision}}'
2626
- name: output-image
27-
value: quay.io/redhat-user-workloads/hyperfleet-tenant/hyperfleet/hyperfleet-api:on-pr-{{revision}}
28-
- name: image-expires-after
29-
value: 5d
27+
value: quay.io/redhat-user-workloads/hyperfleet-tenant/hyperfleet/hyperfleet-api:{{revision}}
28+
- name: target-branch
29+
value: '{{target_branch}}'
3030
- name: dockerfile
3131
value: ./Dockerfile
3232
- name: path-context
@@ -112,6 +112,10 @@ spec:
112112
VMs
113113
name: privileged-nested
114114
type: string
115+
- default: ""
116+
description: Git ref that triggered the build (e.g., refs/tags/v1.0.0-rc1)
117+
name: target-branch
118+
type: string
115119
results:
116120
- description: ""
117121
name: IMAGE_URL
@@ -139,6 +143,29 @@ spec:
139143
- name: kind
140144
value: task
141145
resolver: bundles
146+
- name: extract-version
147+
params:
148+
- name: TAG_REF
149+
value: $(params.target-branch)
150+
taskSpec:
151+
params:
152+
- name: TAG_REF
153+
type: string
154+
results:
155+
- name: VERSION
156+
description: Semantic version extracted from git tag ref
157+
steps:
158+
- name: extract
159+
image: registry.access.redhat.com/ubi9-minimal:latest
160+
script: |
161+
#!/usr/bin/env bash
162+
VERSION="${TAG_REF#refs/tags/v}"
163+
printf '%s' "$VERSION" > "$(results.VERSION.path)"
164+
env:
165+
- name: TAG_REF
166+
value: $(params.TAG_REF)
167+
runAfter:
168+
- init
142169
- name: clone-repository
143170
params:
144171
- name: url
@@ -210,6 +237,7 @@ spec:
210237
- name: BUILD_ARGS
211238
value:
212239
- $(params.build-args[*])
240+
- VERSION=$(tasks.extract-version.results.VERSION)
213241
- name: BUILD_ARGS_FILE
214242
value: $(params.build-args-file)
215243
- name: PRIVILEGED_NESTED

0 commit comments

Comments
 (0)