From 1a54ef77bf90c95d607cb153293f3bce81aa249a Mon Sep 17 00:00:00 2001 From: Khurram Baig Date: Mon, 20 May 2024 16:19:35 +0530 Subject: [PATCH] Add Results Nightly Release --- .../dogfooding/releases/kustomization.yaml | 1 + .../releases/results-nightly/README.md | 2 + .../releases/results-nightly/cronjob.yaml | 21 +++++++++++ .../results-nightly/kustomization.yaml | 5 +++ .../nightly-release/kustomization.yaml | 1 + .../overlays/results/kustomization.yaml | 18 +++++++++ .../overlays/results/template.yaml | 37 +++++++++++++++++++ .../overlays/results/trigger.yaml | 7 ++++ 8 files changed, 92 insertions(+) create mode 100644 tekton/cronjobs/dogfooding/releases/results-nightly/README.md create mode 100644 tekton/cronjobs/dogfooding/releases/results-nightly/cronjob.yaml create mode 100644 tekton/cronjobs/dogfooding/releases/results-nightly/kustomization.yaml create mode 100644 tekton/resources/nightly-release/overlays/results/kustomization.yaml create mode 100644 tekton/resources/nightly-release/overlays/results/template.yaml create mode 100644 tekton/resources/nightly-release/overlays/results/trigger.yaml diff --git a/tekton/cronjobs/dogfooding/releases/kustomization.yaml b/tekton/cronjobs/dogfooding/releases/kustomization.yaml index 92094a0f49..75010514c2 100644 --- a/tekton/cronjobs/dogfooding/releases/kustomization.yaml +++ b/tekton/cronjobs/dogfooding/releases/kustomization.yaml @@ -18,3 +18,4 @@ resources: - pr-status-updater-nightly - concurrency-nightly - workflows-nightly +- results-nightly diff --git a/tekton/cronjobs/dogfooding/releases/results-nightly/README.md b/tekton/cronjobs/dogfooding/releases/results-nightly/README.md new file mode 100644 index 0000000000..ef08d5db33 --- /dev/null +++ b/tekton/cronjobs/dogfooding/releases/results-nightly/README.md @@ -0,0 +1,2 @@ +Cron Job to trigger the Tekton Results nightly build. +Results are published to https://storage.cloud.google.com/tekton-releases-nightly/results/latest/release.yaml diff --git a/tekton/cronjobs/dogfooding/releases/results-nightly/cronjob.yaml b/tekton/cronjobs/dogfooding/releases/results-nightly/cronjob.yaml new file mode 100644 index 0000000000..135e36a5eb --- /dev/null +++ b/tekton/cronjobs/dogfooding/releases/results-nightly/cronjob.yaml @@ -0,0 +1,21 @@ +apiVersion: batch/v1beta1 +kind: CronJob +metadata: + name: nightly-cron-trigger +spec: + schedule: "0 5 * * *" + concurrencyPolicy: Forbid + jobTemplate: + spec: + template: + spec: + containers: + - name: trigger + env: + - name: PROJECT_NAME + value: results + initContainers: + - name: git + env: + - name: GIT_REPO + value: github.com/tektoncd/results diff --git a/tekton/cronjobs/dogfooding/releases/results-nightly/kustomization.yaml b/tekton/cronjobs/dogfooding/releases/results-nightly/kustomization.yaml new file mode 100644 index 0000000000..ef4d563326 --- /dev/null +++ b/tekton/cronjobs/dogfooding/releases/results-nightly/kustomization.yaml @@ -0,0 +1,5 @@ +bases: +- ../../../bases/release +patchesStrategicMerge: +- cronjob.yaml +nameSuffix: "-results-nightly-release" diff --git a/tekton/resources/nightly-release/kustomization.yaml b/tekton/resources/nightly-release/kustomization.yaml index c01f3b452a..f1671baefa 100644 --- a/tekton/resources/nightly-release/kustomization.yaml +++ b/tekton/resources/nightly-release/kustomization.yaml @@ -22,3 +22,4 @@ resources: - overlays/pr-status-updater - overlays/concurrency - overlays/workflows +- overlays/results diff --git a/tekton/resources/nightly-release/overlays/results/kustomization.yaml b/tekton/resources/nightly-release/overlays/results/kustomization.yaml new file mode 100644 index 0000000000..0ea442823d --- /dev/null +++ b/tekton/resources/nightly-release/overlays/results/kustomization.yaml @@ -0,0 +1,18 @@ +namePrefix: results- +bases: + - ../../base +patchesJson6902: + - target: + group: triggers.tekton.dev + version: v1alpha1 + kind: TriggerTemplate + name: template + path: template.yaml + - target: + group: triggers.tekton.dev + version: v1alpha1 + kind: Trigger + name: nightly + path: trigger.yaml +resources: + - github.com/tektoncd/results/release/?ref=main diff --git a/tekton/resources/nightly-release/overlays/results/template.yaml b/tekton/resources/nightly-release/overlays/results/template.yaml new file mode 100644 index 0000000000..70bf9ae4f8 --- /dev/null +++ b/tekton/resources/nightly-release/overlays/results/template.yaml @@ -0,0 +1,37 @@ +- op: add + path: /spec/resourcetemplates + value: + - apiVersion: tekton.dev/v1beta1 + kind: PipelineRun + metadata: + generateName: results-release-nightly- + spec: + pipelineRef: + name: results-release + params: + - name: package + value: $(tt.params.gitrepository) + - name: gitRevision + value: $(tt.params.gitrevision) + - name: imageRegistry + value: $(tt.params.imageRegistry) + - name: imageRegistryPath + value: $(tt.params.imageRegistryPath) + - name: versionTag + value: $(tt.params.versionTag) + - name: serviceAccountPath + value: release.json + - name: releaseBucket + value: gs://tekton-releases-nightly/results + workspaces: + - name: ws + volumeClaimTemplate: + spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 1Gi + - name: release-secret + secret: + secretName: release-secret diff --git a/tekton/resources/nightly-release/overlays/results/trigger.yaml b/tekton/resources/nightly-release/overlays/results/trigger.yaml new file mode 100644 index 0000000000..4de8cdb03e --- /dev/null +++ b/tekton/resources/nightly-release/overlays/results/trigger.yaml @@ -0,0 +1,7 @@ +- op: add + path: /spec/interceptors + value: + - cel: + filter: >- + 'trigger-template' in body && + body.params.release.projectName == 'results'