mirror of
https://github.com/containers/ramalama.git
synced 2026-02-05 06:46:39 +01:00
Avoid rebuilding all images on every PR by only triggering a build when there is a change that will affect the content of the image. If an image is unaffected by a PR, the last successful build triggered by a merge to the main branch will be used for testing. Signed-off-by: Mike Bonnet <mikeb@redhat.com>
48 lines
1.7 KiB
YAML
48 lines
1.7 KiB
YAML
apiVersion: tekton.dev/v1
|
|
kind: PipelineRun
|
|
metadata:
|
|
annotations:
|
|
build.appstudio.openshift.io/repo: https://github.com/containers/ramalama?rev={{revision}}
|
|
build.appstudio.redhat.com/commit_sha: '{{revision}}'
|
|
build.appstudio.redhat.com/pull_request_number: '{{pull_request_number}}'
|
|
build.appstudio.redhat.com/target_branch: '{{target_branch}}'
|
|
pipelinesascode.tekton.dev/cancel-in-progress: "true"
|
|
pipelinesascode.tekton.dev/max-keep-runs: "3"
|
|
pipelinesascode.tekton.dev/on-cel-expression: >-
|
|
event == "pull_request" && target_branch == "main" && body.action != "ready_for_review" &&
|
|
(
|
|
"container-images/scripts/build_stable_diffusion.sh".pathChanged() ||
|
|
"container-images/stable-diffusion/*".pathChanged() ||
|
|
".tekton/pipelines/pull-request-pipeline.yaml".pathChanged() ||
|
|
".tekton/stable-diffusion/stable-diffusion-pull-request.yaml".pathChanged()
|
|
)
|
|
labels:
|
|
appstudio.openshift.io/application: ramalama
|
|
appstudio.openshift.io/component: stable-diffusion
|
|
pipelines.appstudio.openshift.io/type: build
|
|
name: stable-diffusion-on-pull-request
|
|
namespace: ramalama-tenant
|
|
spec:
|
|
params:
|
|
- name: git-url
|
|
value: '{{source_url}}'
|
|
- name: revision
|
|
value: '{{revision}}'
|
|
- name: output-image
|
|
value: quay.io/redhat-user-workloads/ramalama-tenant/stable-diffusion:on-pr-{{revision}}
|
|
- name: image-expires-after
|
|
value: 5d
|
|
- name: dockerfile
|
|
value: container-images/stable-diffusion/Containerfile
|
|
pipelineRef:
|
|
name: pull-request-pipeline
|
|
timeouts:
|
|
pipeline: 12h
|
|
finally: 15m
|
|
taskRunTemplate:
|
|
serviceAccountName: build-pipeline-stable-diffusion
|
|
workspaces:
|
|
- name: git-auth
|
|
secret:
|
|
secretName: '{{ git_auth_secret }}'
|