zuul-jobs/roles/push-to-intermediate-registry/tasks/push-image.yaml
James E. Blair ea00b6aa5a Use human-readable names for artifact returns
This will cause links to appear on the build page with text like
"Docs preview site".

Change-Id: I65f8990b65607e72190a871409c3e31014ce86df
2019-08-12 07:13:27 -07:00

27 lines
1003 B
YAML

- name: Push tag to intermediate registry
command: >-
skopeo --insecure-policy copy
docker://127.0.0.1:{{ socat_port }}/{{ image.repository }}:{{ image_tag }}
docker://{{ intermediate_registry.host | ipwrap }}:{{ intermediate_registry.port }}/{{ image.repository }}:{{ zuul.build }}_{{ image_tag }}
retries: 3
register: result
until: result is success
loop: "{{ image.tags | default(['latest']) }}"
loop_control:
loop_var: image_tag
- name: Return artifact to Zuul
zuul_return:
data:
zuul:
artifacts:
- name: "{{ image.repository }}:{{ image_tag }}"
url: "docker://{{ intermediate_registry.host | ipwrap }}:{{ intermediate_registry.port }}/{{ image.repository }}:{{ zuul.build }}_{{ image_tag }}"
metadata:
type: container_image
repository: "{{ image.repository }}"
tag: "{{ image_tag }}"
loop: "{{ image.tags | default(['latest']) }}"
loop_control:
loop_var: image_tag