Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix release pipeline to handle #1122 #1327

Merged
merged 1 commit into from
Sep 18, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 15 additions & 7 deletions tekton/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -87,13 +87,21 @@ spec:

cat /workspace/go/src/github.com/tektoncd/pipeline/.ko.yaml

- 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/latest/"
- "/workspace/bucket/previous/"
- "/workspace/output/bucket/latest/"
- "/workspace/output/bucket/previous/"

- name: run-ko
# TODO(#639) we should be able to use the image built by an upstream Task here instead of hardcoding
Expand Down Expand Up @@ -123,14 +131,14 @@ spec:
cd /workspace/go/src/github.com/tektoncd/pipeline

# Publish images and create release.yaml
ko resolve --preserve-import-paths -f /workspace/go/src/github.com/tektoncd/pipeline/config/ > /workspace/bucket/latest/release.yaml
ko resolve --preserve-import-paths -f /workspace/go/src/github.com/tektoncd/pipeline/config/ > /workspace/output/bucket/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:
Expand All @@ -139,8 +147,8 @@ spec:
set -e
set -x

mkdir -p /workspace/bucket/previous/$(inputs.params.versionTag)/
cp /workspace/bucket/latest/release.yaml /workspace/bucket/previous/$(inputs.params.versionTag)/release.yaml
mkdir -p /workspace/output/bucket/previous/$(inputs.params.versionTag)/
cp /workspace/output/bucket/latest/release.yaml /workspace/output/bucket/previous/$(inputs.params.versionTag)/release.yaml

- name: tag-images
image: google/cloud-sdk
Expand Down Expand Up @@ -168,7 +176,7 @@ spec:
${inputs.params.imageRegistry}/${inputs.params.pathToProject}/${outputs.resources.builtGcsFetcherImage.url}
)
# Parse the built images from the release.yaml generated by ko
BUILT_IMAGES=( $(/workspace/go/src/github.com/tektoncd/pipeline/tekton/koparse/koparse.py --path /workspace/bucket/latest/release.yaml --base ${inputs.params.imageRegistry}/${inputs.params.pathToProject} --images ${IMAGES[@]}) )
BUILT_IMAGES=( $(/workspace/go/src/github.com/tektoncd/pipeline/tekton/koparse/koparse.py --path /workspace/output/bucket/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
Expand Down