From fc27907b987fc7d4adfa5ca07f3801d589e3b344 Mon Sep 17 00:00:00 2001 From: Andrii Ostapenko Date: Tue, 28 Jan 2020 14:18:53 -0600 Subject: [PATCH] Fix periodic image build jobs Don't try to create change tag if zuul.change is not defined that is the case for periodic builds. Change-Id: I5a7e02caf0f502e90e0477daeee868bf06dfbb5c --- roles/build-docker-image/tasks/build.yaml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/roles/build-docker-image/tasks/build.yaml b/roles/build-docker-image/tasks/build.yaml index b0ba340f3..cb6aa01fd 100644 --- a/roles/build-docker-image/tasks/build.yaml +++ b/roles/build-docker-image/tasks/build.yaml @@ -40,8 +40,10 @@ --build-arg "ZUUL_SIBLINGS={{ item.siblings | join(' ') }}" {% endif -%} {% for tag in item.tags | default(['latest']) -%} - --tag {{ item.repository }}:change_{{ zuul.change }}_{{ tag }} - --tag {{ item.repository }}:{{ tag }} + {% if zuul.change | default(false) -%} + --tag {{ item.repository }}:change_{{ zuul.change }}_{{ tag }} + {% endif -%} + --tag {{ item.repository }}:{{ tag }} {% endfor -%} args: chdir: "{{ zuul_work_dir }}/{{ item.context }}"