Skip to content

Instantly share code, notes, and snippets.

@afrittoli
Created March 13, 2020 11:32
Show Gist options
  • Save afrittoli/25a4fb15cb0e52a28a2c3f8dbbf67878 to your computer and use it in GitHub Desktop.
Save afrittoli/25a4fb15cb0e52a28a2c3f8dbbf67878 to your computer and use it in GitHub Desktop.
apiVersion: tekton.dev/v1alpha1
kind: TaskRun
metadata:
annotations:
kubectl.kubernetes.io/last-applied-configuration: |
{"apiVersion":"tekton.dev/v1alpha1","kind":"Task","metadata":{"annotations":{},"name":"publish-tekton-triggers","namespace":"default"},"spec":{"inputs":{"params":[{"description":"The vX.Y.Z version that the artifacts should be tagged with (including `v`)","name":"versionTag"},{"description":"TODO(tektoncd/pipeline#569) This is a hack to make it easy for folks to switch the registry being used by the many many image outputs","name":"imageRegistry"},{"description":"The path to the folder in the go/src dir that contains the project, which is used by `ko` to name the resulting images","name":"pathToProject"}],"resources":[{"name":"source","targetPath":"go/src/github.com/tektoncd/triggers","type":"git"},{"name":"bucket","type":"storage"}]},"outputs":{"resources":[{"name":"bucket","type":"storage"},{"name":"builtControllerImage","type":"image"},{"name":"builtWebhookImage","type":"image"},{"name":"builtEventListenerSinkImage","type":"image"},{"name":"notification","type":"cloudEvent"}]},"steps":[{"args":["-r","/workspace/bucket","/workspace/output/"],"command":["cp"],"image":"busybox","name":"link-input-bucket-to-output"},{"args":["-p","/workspace/output/bucket/latest/","/workspace/output/bucket/previous/"],"command":["mkdir"],"image":"busybox","name":"ensure-release-dirs-exist"},{"env":[{"name":"KO_DOCKER_REPO","value":"$(inputs.params.imageRegistry)"},{"name":"GOPATH","value":"/workspace/go"},{"name":"CLOUDSDK_AUTH_CREDENTIAL_FILE_OVERRIDE","value":"/secret/release.json"}],"image":"gcr.io/tekton-nightly/ko-ci","name":"run-ko","script":"#!/bin/sh\nset -ex\n\n# Auth with CLOUDSDK_AUTH_CREDENTIAL_FILE_OVERRIDE\ngcloud auth configure-docker\n\n# ko requires this variable to be set in order to set image creation timestamps correctly https://github.com/google/go-containerregistry/pull/146\nexport SOURCE_DATE_EPOCH=`date +%s`\n\n# Change to directory with our .ko.yaml\ncd /workspace/go/src/github.com/tektoncd/triggers\n\n# Publish images and create release.yaml\nko resolve --preserve-import-paths -f /workspace/go/src/github.com/tektoncd/triggers/config/ \u003e /workspace/output/bucket/latest/release.yaml\n","volumeMounts":[{"mountPath":"/secret","name":"gcp-secret"}]},{"image":"busybox","name":"copy-to-tagged-bucket","script":"#!/bin/sh\nset -ex\n\nmkdir -p /workspace/output/bucket/previous/$(inputs.params.versionTag)/\ncp /workspace/output/bucket/latest/release.yaml /workspace/output/bucket/previous/$(inputs.params.versionTag)/release.yaml\n","workingDir":"/workspace/output/bucket"},{"image":"google/cloud-sdk","name":"tag-images","script":"#!/bin/sh\nset -ex\n\nREGIONS=(us eu asia)\nIMAGES=(\n $(inputs.params.imageRegistry)/$(inputs.params.pathToProject)/$(outputs.resources.builtControllerImage.url)\n $(inputs.params.imageRegistry)/$(inputs.params.pathToProject)/$(outputs.resources.builtWebhookImage.url)\n $(inputs.params.imageRegistry)/$(inputs.params.pathToProject)/$(outputs.resources.builtEventListenerSinkImage.url)\n)\n# Parse the built images from the release.yaml generated by ko\nBUILT_IMAGES=( $(/workspace/go/src/github.com/tektoncd/triggers/tekton/koparse/koparse.py --path /workspace/output/bucket/latest/release.yaml --base $(inputs.params.imageRegistry)/$(inputs.params.pathToProject) --images ${IMAGES[@]}) )\n\n# Auth with account credentials\ngcloud auth activate-service-account --key-file=/secret/release.json\n\n# Tag the images and put them in all the regions\nfor IMAGE in \"${BUILT_IMAGES[@]}\"\ndo\n IMAGE_WITHOUT_SHA=${IMAGE%%@*}\n gcloud -q container images add-tag ${IMAGE} ${IMAGE_WITHOUT_SHA}:latest\n gcloud -q container images add-tag ${IMAGE} ${IMAGE_WITHOUT_SHA}:$(inputs.params.versionTag)\n for REGION in \"${REGIONS[@]}\"\n do\n for TAG in \"latest\" $(inputs.params.versionTag)\n do\n gcloud -q container images add-tag ${IMAGE} ${REGION}.${IMAGE_WITHOUT_SHA}:$TAG\n done\n done\ndone\n","volumeMounts":[{"mountPath":"/secret","name":"gcp-secret"}]}],"volumes":[{"name":"gcp-secret","secret":{"secretName":"release-secret"}}]}}
creationTimestamp: "2020-02-10T13:12:45Z"
generation: 1
labels:
app.kubernetes.io/managed-by: tekton-pipelines
tekton.dev/eventlistener: triggers-nightly-release-cron
tekton.dev/pipeline: triggers-release
tekton.dev/pipelineRun: triggers-release-nightly-sk54v
tekton.dev/pipelineTask: publish-images
tekton.dev/task: publish-tekton-triggers
tekton.dev/trigger: triggers-nightly-release-cron-trigger
tekton.dev/triggers-eventid: zlj5v
name: triggers-release-nightly-sk54v-publish-images-9fpzt
namespace: default
ownerReferences:
- apiVersion: tekton.dev/v1alpha1
blockOwnerDeletion: true
controller: true
kind: PipelineRun
name: triggers-release-nightly-sk54v
uid: 2603b677-4c06-11ea-89e2-42010a800124
resourceVersion: "47227327"
selfLink: /apis/tekton.dev/v1alpha1/namespaces/default/taskruns/triggers-release-nightly-sk54v-publish-images-9fpzt
uid: 06ef6f94-4c07-11ea-89e2-42010a800124
spec:
inputs:
params:
- name: pathToProject
value: github.com/tektoncd/triggers
- name: versionTag
value: v20200210-ece7da587d
- name: imageRegistry
value: gcr.io/tekton-nightly
resources:
- name: source
resourceRef:
name: git-source-sk54v
- name: bucket
resourceRef:
name: tekton-bucket-nightly-sk54v
outputs:
resources:
- name: builtEventListenerSinkImage
paths:
- /pvc/publish-images/builtEventListenerSinkImage
resourceRef:
apiVersion: tekton.dev/v1alpha1
name: event-listener-sink-image
- name: notification
paths:
- /pvc/publish-images/notification
resourceRef:
apiVersion: tekton.dev/v1alpha1
name: post-nightly-release-trigger
- name: bucket
paths:
- /pvc/publish-images/bucket
resourceRef:
name: tekton-bucket-nightly-sk54v
- name: builtControllerImage
paths:
- /pvc/publish-images/builtControllerImage
resourceRef:
apiVersion: tekton.dev/v1alpha1
name: triggers-controller-image
- name: builtWebhookImage
paths:
- /pvc/publish-images/builtWebhookImage
resourceRef:
apiVersion: tekton.dev/v1alpha1
name: triggers-webhook-image
serviceAccountName: default
taskRef:
kind: Task
name: publish-tekton-triggers
timeout: 1h0m0s
status:
cloudEvents:
- status:
condition: Sent
message: ""
retryCount: 1
sentAt: "2020-02-10T13:16:59Z"
target: http://el-pipeline-release-post-processing.default:8080
completionTime: "2020-02-10T13:16:59Z"
conditions:
- lastTransitionTime: "2020-02-10T13:16:59Z"
message: '"step-image-digest-exporter-bhdb6" exited with code 1 (image: "docker-pullable://gcr.io/tekton-releases/github.com/tektoncd/pipeline/cmd/imagedigestexporter@sha256:1cf3f27f3ff7c73782d8a65853e8fc7f0d4aafc6443893e0150bdbe614a9169d");
for logs run: kubectl -n default logs triggers-release-nightly-sk54v-publish-images-9fpzt-pod-8wcvh
-c step-image-digest-exporter-bhdb6'
reason: Failed
status: "False"
type: Succeeded
podName: triggers-release-nightly-sk54v-publish-images-9fpzt-pod-8wcvh
startTime: "2020-02-10T13:12:45Z"
steps:
- container: step-create-dir-builteventlistenersinkimage-9cwld
imageID: docker-pullable://busybox@sha256:edafc0a0fb057813850d1ba44014914ca02d671ae247107ca70c94db686e7de6
name: create-dir-builteventlistenersinkimage-9cwld
terminated:
containerID: docker://36fd8c71fedb2bd8f1ff7e635f9932141a2223161923b1a324239da9eb681709
exitCode: 0
finishedAt: "2020-02-10T13:13:23Z"
reason: Completed
startedAt: "2020-02-10T13:13:23Z"
- container: step-ensure-release-dirs-exist
imageID: docker-pullable://busybox@sha256:edafc0a0fb057813850d1ba44014914ca02d671ae247107ca70c94db686e7de6
name: ensure-release-dirs-exist
terminated:
containerID: docker://f63df91c567f321729a3716f04c241206573c75df9acd4d76023477e9ee4a204
exitCode: 0
finishedAt: "2020-02-10T13:13:45Z"
reason: Completed
startedAt: "2020-02-10T13:13:45Z"
- container: step-create-dir-builtcontrollerimage-pk5qw
imageID: docker-pullable://busybox@sha256:edafc0a0fb057813850d1ba44014914ca02d671ae247107ca70c94db686e7de6
name: create-dir-builtcontrollerimage-pk5qw
terminated:
containerID: docker://c2b97ce579f97c1c3526889770d5df704d7ce4824b59385936e1cd32446d8fe3
exitCode: 0
finishedAt: "2020-02-10T13:13:24Z"
reason: Completed
startedAt: "2020-02-10T13:13:24Z"
- container: step-copy-to-tagged-bucket
imageID: docker-pullable://busybox@sha256:edafc0a0fb057813850d1ba44014914ca02d671ae247107ca70c94db686e7de6
name: copy-to-tagged-bucket
terminated:
containerID: docker://e0723824804d25a94f1e8bc1e366c9a7ced8143e08a6102b72197df3e4344f2b
exitCode: 0
finishedAt: "2020-02-10T13:16:56Z"
reason: Completed
startedAt: "2020-02-10T13:16:56Z"
- container: step-create-dir-builtwebhookimage-hnmgk
imageID: docker-pullable://busybox@sha256:edafc0a0fb057813850d1ba44014914ca02d671ae247107ca70c94db686e7de6
name: create-dir-builtwebhookimage-hnmgk
terminated:
containerID: docker://da42271d393107c7ed627e6f6ae1358ff732c1557ff36fd1b96d02922809bdd4
exitCode: 0
finishedAt: "2020-02-10T13:13:23Z"
reason: Completed
startedAt: "2020-02-10T13:13:23Z"
- container: step-create-dir-notification-jq8k2
imageID: docker-pullable://busybox@sha256:edafc0a0fb057813850d1ba44014914ca02d671ae247107ca70c94db686e7de6
name: create-dir-notification-jq8k2
terminated:
containerID: docker://50ca736b75ce5d944089d174ea37176689eaf1c14676a1b5c8e3e664aef48716
exitCode: 0
finishedAt: "2020-02-10T13:13:23Z"
reason: Completed
startedAt: "2020-02-10T13:13:23Z"
- container: step-create-dir-tekton-bucket-nightly-sk54v-82pkd
imageID: docker-pullable://busybox@sha256:edafc0a0fb057813850d1ba44014914ca02d671ae247107ca70c94db686e7de6
name: create-dir-tekton-bucket-nightly-sk54v-82pkd
terminated:
containerID: docker://88e7e430fc38046c1e13642fc269ae49ec512187c76c897956a456eff0755599
exitCode: 0
finishedAt: "2020-02-10T13:13:29Z"
reason: Completed
startedAt: "2020-02-10T13:13:28Z"
- container: step-create-dir-bucket-hplv9
imageID: docker-pullable://busybox@sha256:edafc0a0fb057813850d1ba44014914ca02d671ae247107ca70c94db686e7de6
name: create-dir-bucket-hplv9
terminated:
containerID: docker://bc30bddca63f8111dd380c2c349f76f190dcf9ccc39be06b25698659987ef950
exitCode: 0
finishedAt: "2020-02-10T13:13:24Z"
reason: Completed
startedAt: "2020-02-10T13:13:24Z"
- container: step-fetch-tekton-bucket-nightly-sk54v-mqnfs
imageID: docker-pullable://google/cloud-sdk@sha256:ce27a40af01cefc3f6a1f2d05ad036364a521d0b61dcc5273f2516347792977f
name: fetch-tekton-bucket-nightly-sk54v-mqnfs
terminated:
containerID: docker://9a992c4717826a4486ae9b9dc24d8ad77e1197c918a72dd982aa335cf2ed4e54
exitCode: 0
finishedAt: "2020-02-10T13:13:44Z"
reason: Completed
startedAt: "2020-02-10T13:13:29Z"
- container: step-git-source-git-source-sk54v-tddz8
imageID: docker-pullable://gcr.io/tekton-releases/github.com/tektoncd/pipeline/cmd/git-init@sha256:18ffa2bfc14b1fa6d39f62271beacf6bbc38e7cd2e255184dec477c2936270bc
name: git-source-git-source-sk54v-tddz8
terminated:
containerID: docker://558e9287ddc18c20e8105cfe6387654f6af60d21fc812faf5b76b3dd5e53d4b4
exitCode: 0
finishedAt: "2020-02-10T13:13:28Z"
message: '[{"name":"","digest":"","key":"commit","value":"ece7da587dc70057c5939af7fa293a65330527f9","resourceRef":{}}]'
reason: Completed
startedAt: "2020-02-10T13:13:25Z"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment