diff --git a/tekton/publish.yaml b/tekton/publish.yaml index 0a2def5b8..77ff00bcd 100644 --- a/tekton/publish.yaml +++ b/tekton/publish.yaml @@ -28,13 +28,20 @@ spec: - name: builtEventListenerSinkImage type: image steps: + - name: link-input-bucket-to-output + image: busybox + command: ["cp"] + args: + - -r + - "/workspace/bucket" + - "/workspace/output/" - name: ensure-release-dirs-exist image: busybox command: ["mkdir"] args: - "-p" - - "/workspace/bucket/triggers/latest/" - - "/workspace/bucket/triggers/previous/" + - "/workspace/output/bucket/triggers/latest/" + - "/workspace/output/bucket/triggers/previous/" - name: run-ko image: gcr.io/tekton-releases/ko-ci @@ -63,14 +70,14 @@ spec: cd /workspace/go/src/github.com/tektoncd/triggers # Publish images and create release.yaml - ko resolve --preserve-import-paths -f /workspace/go/src/github.com/tektoncd/triggers/config/ > /workspace/bucket/triggers/latest/release.yaml + ko resolve --preserve-import-paths -f /workspace/go/src/github.com/tektoncd/triggers/config/ > /workspace/output/bucket/triggers/latest/release.yaml volumeMounts: - name: gcp-secret mountPath: /secret - name: copy-to-tagged-bucket image: busybox - workingDir: "/workspace/bucket" + workingDir: "/workspace/output/bucket" command: - /bin/sh args: @@ -79,8 +86,8 @@ spec: set -e set -x - mkdir -p /workspace/bucket/triggers/previous/$(inputs.params.versionTag)/ - cp /workspace/bucket/triggers/latest/release.yaml /workspace/bucket/triggers/previous/$(inputs.params.versionTag)/release.yaml + mkdir -p /workspace/output/bucket/triggers/previous/$(inputs.params.versionTag)/ + cp /workspace/output/bucket/triggers/latest/release.yaml /workspace/output/bucket/triggers/previous/$(inputs.params.versionTag)/release.yaml - name: tag-images image: google/cloud-sdk @@ -99,7 +106,7 @@ spec: ${inputs.params.imageRegistry}/${inputs.params.pathToProject}/${outputs.resources.builtEventListenerSinkImage.url} ) # Parse the built images from the release.yaml generated by ko - BUILT_IMAGES=( $(/workspace/go/src/github.com/tektoncd/triggers/tekton/koparse/koparse.py --path /workspace/bucket/triggers/latest/release.yaml --base ${inputs.params.imageRegistry}/${inputs.params.pathToProject} --images ${IMAGES[@]}) ) + BUILT_IMAGES=( $(/workspace/go/src/github.com/tektoncd/triggers/tekton/koparse/koparse.py --path /workspace/output/bucket/triggers/latest/release.yaml --base ${inputs.params.imageRegistry}/${inputs.params.pathToProject} --images ${IMAGES[@]}) ) # Auth with account credentials gcloud auth activate-service-account --key-file=/secret/release.json