[image-promote] Push also timestamped

Change-Id: Ib32c7b54d198f5013b930fadcb61e742f259dd03
This commit is contained in:
jmarchel 2024-01-09 09:40:03 +01:00 committed by Radosław Piliszek
parent 5464c4c413
commit d844d63789

View File

@ -32,6 +32,21 @@
retries: 3
delay: 30
- name: Generate current timestamp
shell: date +%Y%m%d%H%M%S
register: current_timestamp
- name: Copy image using branch name, commit id and current timestamp
loop: "{{ zj_image.tags | default(['latest']) }}"
loop_control:
loop_var: zj_image_tag
command: >-
skopeo --insecure-policy copy --all {{ zj_artifact_map[zj_image.repository + ':' + zj_image_tag] }} docker://{{ zj_image.repository }}:{{ zuul.branch }}-{{ zuul.commit_id }}-{{ current_timestamp.stdout }}
register: result
until: result.rc == 0
retries: 3
delay: 30
always:
- name: Log out of registry
command: "skopeo logout {{ zj_image.registry }}"