Skip to content

Commit 5af26e5

Browse files
authored
[ISV-2718] Operator release pipeline optionally create latest tag in Quay (#361)
* [ISV-2718] Operator release pipeline optionally create latest tag in Quay
1 parent f6b9a30 commit 5af26e5

File tree

2 files changed

+22
-5
lines changed

2 files changed

+22
-5
lines changed

ansible/roles/operator-pipeline/templates/openshift/pipelines/operator-release-pipeline.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -317,8 +317,12 @@ spec:
317317
params:
318318
- name: src_image
319319
value: *srcBundleImage
320-
- name: dest_image
321-
value: &destBundleImage "$(params.dest_registry)/$(params.dest_image_namespace)/$(tasks.certification-project-check.results.certification_project_id):$(tasks.bundle-path-validation.results.bundle_version)"
320+
- name: is_latest
321+
value: "$(params.is_latest)"
322+
- name: dest_image_registry_namespace_certproject
323+
value: "$(params.dest_registry)/$(params.dest_image_namespace)/$(tasks.certification-project-check.results.certification_project_id)"
324+
- name: dest_image_tag
325+
value: "$(tasks.bundle-path-validation.results.bundle_version)"
322326
workspaces:
323327
- name: src-registry-credentials
324328
workspace: registry-pull-credentials

ansible/roles/operator-pipeline/templates/openshift/tasks/copy-image.yml

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,12 @@ spec:
1010
default: "registry.redhat.io/rhel8/skopeo:8.4-13"
1111
- name: src_image
1212
description: reference to the source bundle image
13-
- name: dest_image
14-
description: reference to the destination bundle image
13+
- name: dest_image_registry_namespace_certproject
14+
description: reference to the destination bundle image registry
15+
- name: dest_image_tag
16+
description: reference to the destination bundle image tag
17+
- name: is_latest
18+
description: If explicitly set to "true", image will be tagged as "latest"
1519
workspaces:
1620
- name: src-registry-credentials
1721
description: Docker config for the source registry
@@ -27,4 +31,13 @@ spec:
2731
--src-authfile $(workspaces.src-registry-credentials.path)/.dockerconfigjson \
2832
--dest-authfile $(workspaces.dest-registry-credentials.path)/.dockerconfigjson \
2933
docker://$(params.src_image) \
30-
docker://$(params.dest_image)
34+
docker://"$(params.dest_image_registry_namespace_certproject):$(params.dest_image_tag)"
35+
36+
# optionally tag destination image as latest
37+
if [ "$(params.is_latest)" = "true" ]; then
38+
skopeo copy \
39+
--src-authfile $(workspaces.src-registry-credentials.path)/.dockerconfigjson \
40+
--dest-authfile $(workspaces.dest-registry-credentials.path)/.dockerconfigjson \
41+
docker://$(params.src_image) \
42+
docker://"$(params.dest_image_registry_namespace_certproject):latest"
43+
fi

0 commit comments

Comments
 (0)