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

Publish tag follow up #1536

Merged
merged 2 commits into from
Nov 8, 2019
Merged
Show file tree
Hide file tree
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
46 changes: 24 additions & 22 deletions tekton/publish-nightly.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,26 @@ spec:
- "/workspace/bucket/latest/"
- "/workspace/bucket/previous/"

- name: generate-release-version
image: alpine/git
command:
- /bin/sh
args:
- -ce
- |
set -e
set -x
# Can't use workingDir due to #1267
cd /workspace/go/src/github.com/tektoncd/pipeline
# Nightly releases use vYYYYMMDD-commit
COMMIT=$(git rev-parse HEAD | cut -c 1-10)
DATE=$(date +"%Y%m%d")
VERSION_TAG="$DATE-$COMMIT"
echo $VERSION_TAG > "/builder/home/version"
- name: run-ko
# TODO(#639) we should be able to use the image built by an upstream Task here instead of hardcoding
image: gcr.io/tekton-nightly/ko-ci
Expand All @@ -110,6 +130,9 @@ spec:
set -e
set -x
# TODO(https://github.com/tektoncd/triggers/issues/87) if the versionTag could be generated dynamically, we could use the same Task for nightly + official releases
export VERSION_TAG="$(cat /builder/home/version)"
# Auth with CLOUDSDK_AUTH_CREDENTIAL_FILE_OVERRIDE
gcloud auth configure-docker
Expand All @@ -133,31 +156,11 @@ spec:
done
# 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 -t $VERSION_TAG -f /workspace/go/src/github.com/tektoncd/pipeline/config/ > /workspace/bucket/latest/release.yaml
volumeMounts:
- name: gcp-secret
mountPath: /secret

- name: generate-release-version
image: alpine/git
command:
- /bin/sh
args:
- -ce
- |
set -e
set -x
# Can't use workingDir due to #1267
cd /workspace/go/src/github.com/tektoncd/pipeline
# Nightly releases use vYYYYMMDD-commit
COMMIT=$(git rev-parse HEAD | cut -c 1-10)
DATE=$(date +"%Y%m%d")
VERSION_TAG="$DATE-$COMMIT"
echo $VERSION_TAG > "/builder/home/version"
- name: copy-to-tagged-bucket
image: busybox
command:
Expand Down Expand Up @@ -215,7 +218,6 @@ spec:
do
IMAGE_WITHOUT_SHA=${IMAGE%%@*}
gcloud -q container images add-tag ${IMAGE} ${IMAGE_WITHOUT_SHA}:latest
gcloud -q container images add-tag ${IMAGE} ${IMAGE_WITHOUT_SHA}:$VERSION_TAG
for REGION in "${REGIONS[@]}"
do
for TAG in "latest" $VERSION_TAG
Expand Down
1 change: 0 additions & 1 deletion tekton/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,6 @@ spec:
do
IMAGE_WITHOUT_SHA=${IMAGE%%@*}
gcloud -q container images add-tag ${IMAGE} ${IMAGE_WITHOUT_SHA}:latest
gcloud -q container images add-tag ${IMAGE} ${IMAGE_WITHOUT_SHA}:$(inputs.params.versionTag)
for REGION in "${REGIONS[@]}"
do
for TAG in "latest" $(inputs.params.versionTag)
Expand Down