zuul-jobs/roles/promote-container-image/tasks/promote-registry.yaml
James E. Blair f381cc328b Update promote-container-image to copy from intermediate registry
Change-Id: Ia24bbd101e01ab371ceacfed006b5ff806418a97
2023-04-12 11:36:26 -07:00

25 lines
821 B
YAML

- name: Log in to registry
no_log: true
command: >-
skopeo login {{ zj_image.registry }} -u {{ container_registry_credentials[zj_image.registry].username }} -p {{ container_registry_credentials[zj_image.registry].password }}
register: result
until: result.rc == 0
retries: 3
delay: 30
- name: Copy image
block:
- name: Copy image
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 }}:{{ zj_image_tag }}
register: result
until: result.rc == 0
retries: 3
delay: 30
always:
- name: Log out of registry
command: "skopeo logout {{ zj_image.registry }}"