From ce3136476a6b7b64f0699c862f0e9a743b764258 Mon Sep 17 00:00:00 2001 From: Monty Taylor Date: Wed, 6 May 2020 16:45:52 -0500 Subject: [PATCH] Tag the images pulled back into docker for changes When building normally we tag the images in docker, this lets upload push them. But in the buildx case, we tag them for the buildset registry but they never end up with change-specific tags on the docker host itself, so they can't be found by the upload playbook. Change-Id: I4f51df3ac67602fd2d48f66639bb0715e7b06cd3 --- roles/build-docker-image/tasks/buildx.yaml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/roles/build-docker-image/tasks/buildx.yaml b/roles/build-docker-image/tasks/buildx.yaml index c18d6895f..a72cea623 100644 --- a/roles/build-docker-image/tasks/buildx.yaml +++ b/roles/build-docker-image/tasks/buildx.yaml @@ -57,5 +57,13 @@ loop_control: loop_var: zj_image_tag +- name: Locally tag for changes so push works later + command: >- + docker tag {{ zj_image.repository }}:{{ zj_image_tag }} {{ zj_image.repository }}:change_{{ zuul.change }}_{{ zj_image_tag }} + loop: "{{ zj_image.tags | default(['latest']) }}" + loop_control: + loop_var: zj_image_tag + when: zuul.change | default(false) + - name: Cleanup sibling source directory include_tasks: clean-siblings.yaml