Skip to content

Instantly share code, notes, and snippets.

@afrittoli
Created July 17, 2025 19:53
Show Gist options
  • Select an option

  • Save afrittoli/3c6edbffd179b5f7a5bdf412ded5c03a to your computer and use it in GitHub Desktop.

Select an option

Save afrittoli/3c6edbffd179b5f7a5bdf412ded5c03a to your computer and use it in GitHub Desktop.
apiVersion: tekton.dev/v1
kind: Pipeline
metadata:
annotations:
kubectl.kubernetes.io/last-applied-configuration: |
{"apiVersion":"tekton.dev/v1beta1","kind":"Pipeline","metadata":{"annotations":{"managed-by":"Tekton"},"name":"dashboard-dashboard-release","namespace":"tekton-nightly"},"spec":{"params":[{"default":"github.com/tektoncd/dashboard","description":"package to release","name":"package"},{"description":"the git revision to release","name":"gitRevision"},{"default":"gcr.io","description":"The target image registry","name":"imageRegistry"},{"default":"tekton-releases","description":"The path (project) in the image registry","name":"imageRegistryPath"},{"default":"us eu asia","description":"The target image registry regions","name":"imageRegistryRegions"},{"default":"_json_key","description":"The user for the image registry credentials","name":"imageRegistryUser"},{"description":"The X.Y.Z version that the artifacts should be tagged with","name":"versionTag"},{"default":"gs://tekton-releases-nightly/dashboard","description":"bucket where the release is stored. The bucket must be project specific.","name":"releaseBucket"},{"default":"true","description":"Whether to tag and publish this release as Pipelines' latest","name":"releaseAsLatest"},{"default":"linux/amd64,linux/arm,linux/arm64,linux/s390x,linux/ppc64le","description":"Platforms to publish for the images (e.g. linux/amd64,linux/arm64)","name":"platforms"},{"default":"--preserve-import-paths","description":"Extra args to be passed to ko","name":"koExtraArgs"},{"description":"The path to the service account file within the release-secret workspace","name":"serviceAccountPath"},{"description":"The path to the service account file or credentials within the release-images-secret workspace","name":"serviceAccountImagesPath"}],"results":[{"description":"the sha of the commit that was released","name":"commit-sha","value":"$(tasks.git-clone.results.commit)"},{"description":"the URL of the release file","name":"release-file","value":"$(tasks.report-bucket.results.release)"},{"description":"the URL of the release file","name":"release-file-full","value":"$(tasks.report-bucket.results.release-full)"}],"tasks":[{"name":"git-clone","params":[{"name":"url","value":"https://$(params.package)"},{"name":"revision","value":"$(params.gitRevision)"}],"taskRef":{"name":"git-clone"},"workspaces":[{"name":"output","subpath":"git","workspace":"workarea"}]},{"name":"precheck","params":[{"name":"package","value":"$(params.package)"},{"name":"versionTag","value":"$(params.versionTag)"},{"name":"releaseBucket","value":"$(params.releaseBucket)"}],"runAfter":["git-clone"],"taskRef":{"name":"dashboard-dashboard-prerelease-checks"},"workspaces":[{"name":"source-to-release","subpath":"git","workspace":"workarea"}]},{"name":"build","runAfter":["precheck"],"taskRef":{"name":"dashboard-build-dashboard"},"workspaces":[{"name":"source","subpath":"git","workspace":"workarea"}]},{"name":"publish-images","params":[{"name":"package","value":"$(params.package)"},{"name":"versionTag","value":"$(params.versionTag)"},{"name":"imageRegistry","value":"$(params.imageRegistry)"},{"name":"imageRegistryPath","value":"$(params.imageRegistryPath)"},{"name":"imageRegistryUser","value":"$(params.imageRegistryUser)"},{"name":"imageRegistryRegions","value":"$(params.imageRegistryRegions)"},{"name":"releaseAsLatest","value":"$(params.releaseAsLatest)"},{"name":"serviceAccountPath","value":"$(params.serviceAccountImagesPath)"},{"name":"platforms","value":"$(params.platforms)"},{"name":"koExtraArgs","value":"$(params.koExtraArgs)"}],"runAfter":["build"],"taskRef":{"name":"dashboard-publish-dashboard-release"},"workspaces":[{"name":"source","subpath":"git","workspace":"workarea"},{"name":"output","subpath":"bucket","workspace":"workarea"},{"name":"release-secret","workspace":"release-images-secret"}]},{"name":"publish-to-bucket","params":[{"name":"location","value":"$(params.releaseBucket)/previous/$(params.versionTag)"},{"name":"path","value":"$(params.versionTag)"},{"name":"serviceAccountPath","value":"$(params.serviceAccountPath)"}],"runAfter":["publish-images"],"taskRef":{"name":"gcs-upload"},"workspaces":[{"name":"credentials","workspace":"release-secret"},{"name":"source","subpath":"bucket","workspace":"workarea"}]},{"name":"publish-to-bucket-latest","params":[{"name":"location","value":"$(params.releaseBucket)/latest"},{"name":"path","value":"$(params.versionTag)"},{"name":"serviceAccountPath","value":"$(params.serviceAccountPath)"}],"runAfter":["publish-images"],"taskRef":{"name":"gcs-upload"},"when":[{"input":"$(params.releaseAsLatest)","operator":"in","values":["true"]}],"workspaces":[{"name":"credentials","workspace":"release-secret"},{"name":"source","subpath":"bucket","workspace":"workarea"}]},{"name":"report-bucket","params":[{"name":"releaseBucket","value":"$(params.releaseBucket)"},{"name":"versionTag","value":"$(params.versionTag)"}],"runAfter":["publish-to-bucket"],"taskSpec":{"params":[{"name":"releaseBucket"},{"name":"versionTag"}],"results":[{"description":"The full URL of the release file (read-only) in the bucket","name":"release","type":"string"},{"description":"The full URL of the release file (read/write) in the bucket","name":"release-full","type":"string"}],"steps":[{"image":"docker.io/library/alpine:3.20.3@sha256:beefdbd8a1da6d2915566fde36db9db0b524eb737fc57cd1367effd16dc0d06d","name":"create-results","script":"BASE_URL=$(echo \"$(params.releaseBucket)/previous/$(params.versionTag)\")\n# If the bucket is in the gs:// return the corresponding public https URL\nBASE_URL=$(echo ${BASE_URL} | sed 's,gs://,https://storage.googleapis.com/,g')\necho \"${BASE_URL}/release.yaml\" \u003e $(results.release.path)\necho \"${BASE_URL}/release-full.yaml\" \u003e $(results.release-full.path)\n"}]}}],"workspaces":[{"description":"The workspace where the repo will be cloned.","name":"workarea"},{"description":"The secret that contains a service account authorized to push to the output bucket","name":"release-secret"},{"description":"The secret that contains a service account authorized to push to the image registry","name":"release-images-secret"}]}}
managed-by: Tekton
creationTimestamp: "2025-03-24T14:40:57Z"
generation: 1
name: dashboard-dashboard-release
namespace: tekton-nightly
resourceVersion: "4974595"
uid: d574b704-7230-4552-adde-eb58a74e15f8
spec:
params:
- default: github.com/tektoncd/dashboard
description: package to release
name: package
type: string
- description: the git revision to release
name: gitRevision
type: string
- default: gcr.io
description: The target image registry
name: imageRegistry
type: string
- default: tekton-releases
description: The path (project) in the image registry
name: imageRegistryPath
type: string
- default: us eu asia
description: The target image registry regions
name: imageRegistryRegions
type: string
- default: _json_key
description: The user for the image registry credentials
name: imageRegistryUser
type: string
- description: The X.Y.Z version that the artifacts should be tagged with
name: versionTag
type: string
- default: gs://tekton-releases-nightly/dashboard
description: bucket where the release is stored. The bucket must be project specific.
name: releaseBucket
type: string
- default: "true"
description: Whether to tag and publish this release as Pipelines' latest
name: releaseAsLatest
type: string
- default: linux/amd64,linux/arm,linux/arm64,linux/s390x,linux/ppc64le
description: Platforms to publish for the images (e.g. linux/amd64,linux/arm64)
name: platforms
type: string
- default: --preserve-import-paths
description: Extra args to be passed to ko
name: koExtraArgs
type: string
- description: The path to the service account file within the release-secret workspace
name: serviceAccountPath
type: string
- description: The path to the service account file or credentials within the release-images-secret
workspace
name: serviceAccountImagesPath
type: string
results:
- description: the sha of the commit that was released
name: commit-sha
value: $(tasks.git-clone.results.commit)
- description: the URL of the release file
name: release-file
value: $(tasks.report-bucket.results.release)
- description: the URL of the release file
name: release-file-full
value: $(tasks.report-bucket.results.release-full)
tasks:
- name: git-clone
params:
- name: url
value: https://$(params.package)
- name: revision
value: $(params.gitRevision)
taskRef:
kind: Task
name: git-clone
workspaces:
- name: output
subPath: git
workspace: workarea
- name: precheck
params:
- name: package
value: $(params.package)
- name: versionTag
value: $(params.versionTag)
- name: releaseBucket
value: $(params.releaseBucket)
runAfter:
- git-clone
taskRef:
kind: Task
name: dashboard-dashboard-prerelease-checks
workspaces:
- name: source-to-release
subPath: git
workspace: workarea
- name: build
runAfter:
- precheck
taskRef:
kind: Task
name: dashboard-build-dashboard
workspaces:
- name: source
subPath: git
workspace: workarea
- name: publish-images
params:
- name: package
value: $(params.package)
- name: versionTag
value: $(params.versionTag)
- name: imageRegistry
value: $(params.imageRegistry)
- name: imageRegistryPath
value: $(params.imageRegistryPath)
- name: imageRegistryUser
value: $(params.imageRegistryUser)
- name: imageRegistryRegions
value: $(params.imageRegistryRegions)
- name: releaseAsLatest
value: $(params.releaseAsLatest)
- name: serviceAccountPath
value: $(params.serviceAccountImagesPath)
- name: platforms
value: $(params.platforms)
- name: koExtraArgs
value: $(params.koExtraArgs)
runAfter:
- build
taskRef:
kind: Task
name: dashboard-publish-dashboard-release
workspaces:
- name: source
subPath: git
workspace: workarea
- name: output
subPath: bucket
workspace: workarea
- name: release-secret
workspace: release-images-secret
- name: publish-to-bucket
params:
- name: location
value: $(params.releaseBucket)/previous/$(params.versionTag)
- name: path
value: $(params.versionTag)
- name: serviceAccountPath
value: $(params.serviceAccountPath)
runAfter:
- publish-images
taskRef:
kind: Task
name: gcs-upload
workspaces:
- name: credentials
workspace: release-secret
- name: source
subPath: bucket
workspace: workarea
- name: publish-to-bucket-latest
params:
- name: location
value: $(params.releaseBucket)/latest
- name: path
value: $(params.versionTag)
- name: serviceAccountPath
value: $(params.serviceAccountPath)
runAfter:
- publish-images
taskRef:
kind: Task
name: gcs-upload
when:
- input: $(params.releaseAsLatest)
operator: in
values:
- "true"
workspaces:
- name: credentials
workspace: release-secret
- name: source
subPath: bucket
workspace: workarea
- name: report-bucket
params:
- name: releaseBucket
value: $(params.releaseBucket)
- name: versionTag
value: $(params.versionTag)
runAfter:
- publish-to-bucket
taskSpec:
metadata: {}
params:
- name: releaseBucket
type: string
- name: versionTag
type: string
results:
- description: The full URL of the release file (read-only) in the bucket
name: release
type: string
- description: The full URL of the release file (read/write) in the bucket
name: release-full
type: string
spec: null
steps:
- computeResources: {}
image: docker.io/library/alpine:3.20.3@sha256:beefdbd8a1da6d2915566fde36db9db0b524eb737fc57cd1367effd16dc0d06d
name: create-results
script: |
BASE_URL=$(echo "$(params.releaseBucket)/previous/$(params.versionTag)")
# If the bucket is in the gs:// return the corresponding public https URL
BASE_URL=$(echo ${BASE_URL} | sed 's,gs://,https://storage.googleapis.com/,g')
echo "${BASE_URL}/release.yaml" > $(results.release.path)
echo "${BASE_URL}/release-full.yaml" > $(results.release-full.path)
workspaces:
- description: The workspace where the repo will be cloned.
name: workarea
- description: The secret that contains a service account authorized to push to
the output bucket
name: release-secret
- description: The secret that contains a service account authorized to push to
the image registry
name: release-images-secret
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment