diff --git a/roles/push-to-intermediate-registry/tasks/push-image.yaml b/roles/push-to-intermediate-registry/tasks/push-image.yaml index 47a064829..91bf51401 100644 --- a/roles/push-to-intermediate-registry/tasks/push-image.yaml +++ b/roles/push-to-intermediate-registry/tasks/push-image.yaml @@ -5,12 +5,12 @@ - name: Push tag to intermediate registry command: >- skopeo --insecure-policy copy - docker://127.0.0.1:{{ socat_port }}/{{ image.repository | regex_replace('^docker\.io/(.*)', '\1') }}:{{ zj_image_tag }} - docker://{{ intermediate_registry.host | ipwrap }}:{{ intermediate_registry.port }}/{{ image.repository }}:{{ zuul.build }}_{{ zj_image_tag }} + docker://127.0.0.1:{{ socat_port }}/{{ zj_image.repository | regex_replace('^docker\.io/(.*)', '\1') }}:{{ zj_image_tag }} + docker://{{ intermediate_registry.host | ipwrap }}:{{ intermediate_registry.port }}/{{ zj_image.repository }}:{{ zuul.build }}_{{ zj_image_tag }} retries: 3 register: result until: result is success - loop: "{{ image.tags | default(['latest']) }}" + loop: "{{ zj_image.tags | default(['latest']) }}" loop_control: loop_var: zj_image_tag @@ -19,12 +19,12 @@ data: zuul: artifacts: - - name: "{{ image.repository }}:{{ zj_image_tag }}" - url: "docker://{{ intermediate_registry.host | ipwrap }}:{{ intermediate_registry.port }}/{{ image.repository }}:{{ zuul.build }}_{{ zj_image_tag }}" + - name: "{{ zj_image.repository }}:{{ zj_image_tag }}" + url: "docker://{{ intermediate_registry.host | ipwrap }}:{{ intermediate_registry.port }}/{{ zj_image.repository }}:{{ zuul.build }}_{{ zj_image_tag }}" metadata: type: container_image - repository: "{{ image.repository }}" + repository: "{{ zj_image.repository }}" tag: "{{ zj_image_tag }}" - loop: "{{ image.tags | default(['latest']) }}" + loop: "{{ zj_image.tags | default(['latest']) }}" loop_control: loop_var: zj_image_tag diff --git a/roles/push-to-intermediate-registry/tasks/push.yaml b/roles/push-to-intermediate-registry/tasks/push.yaml index 03f63bffe..a85a3b3ce 100644 --- a/roles/push-to-intermediate-registry/tasks/push.yaml +++ b/roles/push-to-intermediate-registry/tasks/push.yaml @@ -80,7 +80,7 @@ include_tasks: push-image.yaml loop: "{{ docker_images }}" loop_control: - loop_var: image + loop_var: zj_image always: - name: Remove docker user config command: "shred ~/.docker/config.json"