Skip to content

Commit fa9dffe

Browse files
vdemeestertekton-robot
authored andcommitted
tekton: migrate release task and pipeline to v1beta1
This extracts the migration to v1beta1 part from #2897. Release tasks and pipelines from the `tekton/` folder are migrated to use v1beta1 APIs. Signed-off-by: Vincent Demeester <[email protected]>
1 parent 8ecaa29 commit fa9dffe

File tree

3 files changed

+27
-27
lines changed

3 files changed

+27
-27
lines changed

tekton/publish.yaml

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
apiVersion: tekton.dev/v1alpha1
1+
apiVersion: tekton.dev/v1beta1
22
kind: Task
33
metadata:
44
name: publish-tekton-pipelines
@@ -56,7 +56,7 @@ spec:
5656
- /kaniko/executor
5757
args:
5858
- --dockerfile=/workspace/go/src/github.com/tektoncd/pipeline/images/Dockerfile
59-
- --destination=$(inputs.params.imageRegistry)/$(inputs.params.pathToProject)/$(outputs.resources.builtBaseImage.url)
59+
- --destination=$(params.imageRegistry)/$(params.pathToProject)/$(resources.outputs.builtBaseImage.url)
6060
- --context=/workspace/go/src/github.com/tektoncd/pipeline
6161

6262
volumeMounts:
@@ -76,8 +76,8 @@ spec:
7676
# This matches the value configured in .ko.yaml
7777
defaultBaseImage: gcr.io/distroless/static:nonroot
7878
baseImageOverrides:
79-
$(inputs.params.pathToProject)/$(outputs.resources.builtCredsInitImage.url): $(inputs.params.imageRegistry)/$(inputs.params.pathToProject)/build-base:latest
80-
$(inputs.params.pathToProject)/$(outputs.resources.builtGitInitImage.url): $(inputs.params.imageRegistry)/$(inputs.params.pathToProject)/build-base:latest
79+
$(params.pathToProject)/$(resources.outputs.builtCredsInitImage.url): $(params.imageRegistry)/$(params.pathToProject)/build-base:latest
80+
$(params.pathToProject)/$(resources.outputs.builtGitInitImage.url): $(params.imageRegistry)/$(params.pathToProject)/build-base:latest
8181
8282
# These match values configured in .ko.yaml
8383
$(inputs.params.pathToProject)/$(outputs.resources.builtEntrypointImage.url): gcr.io/distroless/base:debug-nonroot
@@ -100,13 +100,13 @@ spec:
100100
command: ["mkdir"]
101101
args:
102102
- "-p"
103-
- "/workspace/output/bucket/previous/$(inputs.params.versionTag)/"
103+
- "/workspace/output/bucket/previous/$(params.versionTag)/"
104104

105105
- name: run-ko
106106
image: gcr.io/tekton-releases/dogfooding/ko-gcloud:latest
107107
env:
108108
- name: KO_DOCKER_REPO
109-
value: $(inputs.params.imageRegistry)
109+
value: $(params.imageRegistry)
110110
- name: GOPATH
111111
value: /workspace/go
112112
- name: GO111MODULE
@@ -147,10 +147,10 @@ spec:
147147
# Rewrite "devel" to inputs.params.versionTag
148148
sed -i -e 's/\(pipeline.tekton.dev\/release\): "devel"/\1: "$(inputs.params.versionTag)"/g' -e 's/\(app.kubernetes.io\/version\): "devel"/\1: "$(inputs.params.versionTag)"/g' -e 's/\(version\): "devel"/\1: "$(inputs.params.versionTag)"/g' -e 's/\("-version"\), "devel"/\1, "$(inputs.params.versionTag)"/g' /workspace/go/src/github.com/tektoncd/pipeline/config/*.yaml
149149
150-
OUTPUT_BUCKET_RELEASE_DIR="/workspace/output/bucket/previous/$(inputs.params.versionTag)"
150+
OUTPUT_BUCKET_RELEASE_DIR="/workspace/output/bucket/previous/$(params.versionTag)"
151151
152152
# Publish images and create release.yaml
153-
ko resolve --preserve-import-paths -t $(inputs.params.versionTag) -f /workspace/go/src/github.com/tektoncd/pipeline/config/ > $OUTPUT_BUCKET_RELEASE_DIR/release.yaml
153+
ko resolve --preserve-import-paths -t $(params.versionTag) -f /workspace/go/src/github.com/tektoncd/pipeline/config/ > $OUTPUT_BUCKET_RELEASE_DIR/release.yaml
154154
# Publish images and create release.notags.yaml
155155
# This is useful if your container runtime doesn't support the `image-reference:tag@digest` notation
156156
# This is currently the case for `cri-o` (and most likely others)
@@ -166,10 +166,10 @@ spec:
166166
#!/bin/sh
167167
set -ex
168168
169-
if [[ "$(inputs.params.releaseAsLatest)" == "true" ]]
169+
if [[ "$(params.releaseAsLatest)" == "true" ]]
170170
then
171171
mkdir -p "/workspace/output/bucket/latest/"
172-
OUTPUT_BUCKET_RELEASE_DIR="/workspace/output/bucket/previous/$(inputs.params.versionTag)"
172+
OUTPUT_BUCKET_RELEASE_DIR="/workspace/output/bucket/previous/$(params.versionTag)"
173173
OUTPUT_BUCKET_LATEST_DIR="/workspace/output/bucket/latest"
174174
cp "$OUTPUT_BUCKET_RELEASE_DIR/release.yaml" "$OUTPUT_BUCKET_LATEST_DIR/release.yaml"
175175
cp "$OUTPUT_BUCKET_RELEASE_DIR/release.notags.yaml" "$OUTPUT_BUCKET_LATEST_DIR/release.notags.yaml"
@@ -183,19 +183,19 @@ spec:
183183
184184
REGIONS=(us eu asia)
185185
IMAGES=(
186-
$(inputs.params.imageRegistry)/$(inputs.params.pathToProject)/$(outputs.resources.builtEntrypointImage.url):$(inputs.params.versionTag)
187-
$(inputs.params.imageRegistry)/$(inputs.params.pathToProject)/$(outputs.resources.builtNopImage.url):$(inputs.params.versionTag)
188-
$(inputs.params.imageRegistry)/$(inputs.params.pathToProject)/$(outputs.resources.builtKubeconfigWriterImage.url):$(inputs.params.versionTag)
189-
$(inputs.params.imageRegistry)/$(inputs.params.pathToProject)/$(outputs.resources.builtCredsInitImage.url):$(inputs.params.versionTag)
190-
$(inputs.params.imageRegistry)/$(inputs.params.pathToProject)/$(outputs.resources.builtGitInitImage.url):$(inputs.params.versionTag)
191-
$(inputs.params.imageRegistry)/$(inputs.params.pathToProject)/$(outputs.resources.builtControllerImage.url):$(inputs.params.versionTag)
192-
$(inputs.params.imageRegistry)/$(inputs.params.pathToProject)/$(outputs.resources.builtWebhookImage.url):$(inputs.params.versionTag)
193-
$(inputs.params.imageRegistry)/$(inputs.params.pathToProject)/$(outputs.resources.builtDigestExporterImage.url):$(inputs.params.versionTag)
194-
$(inputs.params.imageRegistry)/$(inputs.params.pathToProject)/$(outputs.resources.builtPullRequestInitImage.url):$(inputs.params.versionTag)
195-
$(inputs.params.imageRegistry)/$(inputs.params.pathToProject)/$(outputs.resources.builtGcsFetcherImage.url):$(inputs.params.versionTag)
186+
$(params.imageRegistry)/$(params.pathToProject)/$(resources.outputs.builtEntrypointImage.url):$(params.versionTag)
187+
$(params.imageRegistry)/$(params.pathToProject)/$(resources.outputs.builtNopImage.url):$(params.versionTag)
188+
$(params.imageRegistry)/$(params.pathToProject)/$(resources.outputs.builtKubeconfigWriterImage.url):$(params.versionTag)
189+
$(params.imageRegistry)/$(params.pathToProject)/$(resources.outputs.builtCredsInitImage.url):$(params.versionTag)
190+
$(params.imageRegistry)/$(params.pathToProject)/$(resources.outputs.builtGitInitImage.url):$(params.versionTag)
191+
$(params.imageRegistry)/$(params.pathToProject)/$(resources.outputs.builtControllerImage.url):$(params.versionTag)
192+
$(params.imageRegistry)/$(params.pathToProject)/$(resources.outputs.builtWebhookImage.url):$(params.versionTag)
193+
$(params.imageRegistry)/$(params.pathToProject)/$(resources.outputs.builtDigestExporterImage.url):$(params.versionTag)
194+
$(params.imageRegistry)/$(params.pathToProject)/$(resources.outputs.builtPullRequestInitImage.url):$(params.versionTag)
195+
$(params.imageRegistry)/$(params.pathToProject)/$(resources.outputs.builtGcsFetcherImage.url):$(params.versionTag)
196196
)
197197
# Parse the built images from the release.yaml generated by ko
198-
BUILT_IMAGES=( $(/workspace/go/src/github.com/tektoncd/pipeline/tekton/koparse/koparse.py --path /workspace/output/bucket/previous/$(inputs.params.versionTag)/release.yaml --base $(inputs.params.imageRegistry)/$(inputs.params.pathToProject) --images ${IMAGES[@]}) )
198+
BUILT_IMAGES=( $(/workspace/go/src/github.com/tektoncd/pipeline/tekton/koparse/koparse.py --path /workspace/output/bucket/previous/$(params.versionTag)/release.yaml --base $(params.imageRegistry)/$(params.pathToProject) --images ${IMAGES[@]}) )
199199
200200
# Auth with account credentials
201201
gcloud auth activate-service-account --key-file=/secret/release.json
@@ -207,21 +207,21 @@ spec:
207207
IMAGE_WITHOUT_SHA_AND_TAG=${IMAGE_WITHOUT_SHA%%:*}
208208
IMAGE_WITH_SHA=${IMAGE_WITHOUT_SHA_AND_TAG}@${IMAGE##*@}
209209
210-
if [[ "$(inputs.params.releaseAsLatest)" == "true" ]]
210+
if [[ "$(params.releaseAsLatest)" == "true" ]]
211211
then
212212
gcloud -q container images add-tag ${IMAGE_WITH_SHA} ${IMAGE_WITHOUT_SHA_AND_TAG}:latest
213213
fi
214214
215215
for REGION in "${REGIONS[@]}"
216216
do
217-
if [[ "$(inputs.params.releaseAsLatest)" == "true" ]]
217+
if [[ "$(params.releaseAsLatest)" == "true" ]]
218218
then
219-
for TAG in "latest" $(inputs.params.versionTag)
219+
for TAG in "latest" $(params.versionTag)
220220
do
221221
gcloud -q container images add-tag ${IMAGE_WITH_SHA} ${REGION}.${IMAGE_WITHOUT_SHA_AND_TAG}:$TAG
222222
done
223223
else
224-
TAG="$(inputs.params.versionTag)"
224+
TAG="$(params.versionTag)"
225225
gcloud -q container images add-tag ${IMAGE_WITH_SHA} ${REGION}.${IMAGE_WITHOUT_SHA_AND_TAG}:$TAG
226226
fi
227227
done

tekton/release-pipeline-nightly.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
apiVersion: tekton.dev/v1alpha1
1+
apiVersion: tekton.dev/v1beta1
22
kind: Pipeline
33
metadata:
44
name: pipeline-release-nightly

tekton/release-pipeline.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
apiVersion: tekton.dev/v1alpha1
2+
apiVersion: tekton.dev/v1beta1
33
kind: Pipeline
44
metadata:
55
name: pipeline-release

0 commit comments

Comments
 (0)