From 0ac452ea28c73f4819892b0a86634fbaf47e5aa0 Mon Sep 17 00:00:00 2001 From: Monty Taylor Date: Wed, 23 Jan 2019 17:58:30 +0000 Subject: [PATCH] Apply requested tags locally for docker build When doing the local build, go ahead and apply the tags to the local image, so that one can use the role for building local images for testing that will eventually be published with the given tag. Change-Id: I0249ddc4f9a8a2e17466f96a5711672282ce025c --- roles/build-docker-image/tasks/main.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/roles/build-docker-image/tasks/main.yaml b/roles/build-docker-image/tasks/main.yaml index 904282e14..5b8fe616b 100644 --- a/roles/build-docker-image/tasks/main.yaml +++ b/roles/build-docker-image/tasks/main.yaml @@ -8,6 +8,9 @@ --build-arg {{ build_arg }} {% endfor -%} --tag {{ item.repository }}:change_{{ zuul.change }} + {% for tag in item.tags | default(['latest']) -%} + --tag {{ item.repository }}:{{ tag }} + {% endfor -%} args: chdir: "{{ zuul_work_dir }}/{{ item.context }}" loop: "{{ docker_images }}"