Skip to content

ci(frontend): build pinned commit on master push via Pipelines-as-Code - #1164

Merged
verseghy-prow[bot] merged 1 commit into
masterfrom
pac-build-trigger
Jun 7, 2026
Merged

verseghy-prow[bot] merged 1 commit into
masterfrom
pac-build-trigger

Conversation

@TwoDCube

@TwoDCube TwoDCube commented Jun 6, 2026 •

Copy link
Copy Markdown
Member

What

Adds .tekton/push.yaml so every push to master rebuilds the frontend image, pinned to the exact pushed commit.

How it works

On a push to master, Pipelines-as-Code runs this PipelineRun in the verseghy namespace. Its single task references the cluster's maintained openshift-client task (via the cluster resolver — no hand-rolled taskSpec/image), whose SCRIPT:

  1. oc creates a self-contained Shipwright BuildRun — the full build recipe lives inline in spec.build.spec, with source.git.revision pinned to the pushed SHA (a BuildRun referencing a Build by name can't override the revision);
  2. oc wait --for=jsonpath='{.status.completionTime}' blocks until the build finishes — this returns on success or failure, so there's no polling loop;
  3. checks the Succeeded condition and exits non-zero on failure, so the result lands on the commit as a GitHub check.

Runs as the pipeline SA (has create/get buildruns via ClusterRole/edit).

Companion PR

Verseghy/website_k8s #28 — removes the now-unreferenced standalone Build CRs and keeps only the PAC Repository bindings.

Validation

yq parse, prettier --check, server-side dry-run of the PipelineRun and the generated BuildRun, and a live throwaway PipelineRun confirming the cluster resolver + pipeline SA execute oc successfully — all green against the live cluster.

@TwoDCube
TwoDCube force-pushed the pac-build-trigger branch from 7e8ea5d to 4208768 Compare June 6, 2026 16:38
@TwoDCube TwoDCube changed the title Add Pipelines-as-Code trigger: build image on master push ci(frontend): build image on master push via Pipelines-as-Code Jun 6, 2026
@TwoDCube
TwoDCube force-pushed the pac-build-trigger branch from 4208768 to 93e15c7 Compare June 6, 2026 17:11
On a push to master, Pipelines-as-Code runs the maintained openshift-client
task, which creates a self-contained Shipwright BuildRun (embedded build.spec
pinned to the pushed commit) and `oc wait`s for it, reporting the result back as
a GitHub check. No standalone Build CR and no polling loop are required.
@TwoDCube
TwoDCube force-pushed the pac-build-trigger branch from 93e15c7 to 2b79d44 Compare June 6, 2026 17:25
@TwoDCube TwoDCube changed the title ci(frontend): build image on master push via Pipelines-as-Code ci(frontend): build pinned commit on master push via Pipelines-as-Code Jun 6, 2026
@smrtrfszm

Copy link
Copy Markdown
Member

/lgtm
/approve

@verseghy-prow verseghy-prow Bot added the lgtm Indicates that a PR is ready to be merged. label Jun 6, 2026
@TwoDCube

TwoDCube commented Jun 7, 2026

Copy link
Copy Markdown
Member Author

/approve

@TwoDCube TwoDCube added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jun 7, 2026
@verseghy-prow

verseghy-prow Bot commented Jun 7, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: smrtrfszm, TwoDCube

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@verseghy-prow
verseghy-prow Bot merged commit 96a1b49 into master Jun 7, 2026
2 checks passed
@verseghy-prow
verseghy-prow Bot deleted the pac-build-trigger branch June 7, 2026 18:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants