From a7b4e5e906f07a234633b8791b3ceb8f8de0c2cd Mon Sep 17 00:00:00 2001 From: Albin Vass Date: Mon, 4 May 2020 17:11:32 +0200 Subject: [PATCH] Fix bare 'item' in build-container-image Move the setting of the containerfile into the loop (thus in build.yaml) to follow the semantics from roles/build-container-image/common.rst for container_filename and container_images.container_filename. Co-Authored-By: Andreas Jaeger Change-Id: Id39f13cc666e9f99557447073cc0d362991f3506 --- roles/build-container-image/tasks/build.yaml | 4 ++++ roles/build-container-image/tasks/main.yaml | 4 ---- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/roles/build-container-image/tasks/build.yaml b/roles/build-container-image/tasks/build.yaml index cb610b83a..af0fe1a72 100644 --- a/roles/build-container-image/tasks/build.yaml +++ b/roles/build-container-image/tasks/build.yaml @@ -25,6 +25,10 @@ loop_var: zj_sibling when: item.siblings is defined +- name: Set container filename arg + set_fact: + containerfile: "{{ item.container_filename|default(container_filename)|default('') }}" + - name: Build a container image command: >- {{ container_command }} build {{ item.path | default('.') }} {% if containerfile %}-f {{ containerfile }}{% endif %} diff --git a/roles/build-container-image/tasks/main.yaml b/roles/build-container-image/tasks/main.yaml index fdc685dac..be341ab90 100644 --- a/roles/build-container-image/tasks/main.yaml +++ b/roles/build-container-image/tasks/main.yaml @@ -14,10 +14,6 @@ - result_json_stat.stat.size > 0 - "'buildset_registry' in (lookup('file', zuul.executor.work_root + '/results.json') | from_json)" -- name: Set container filename arg - set_fact: - containerfile: "{{ item.container_filename|default(container_filename|default('')) }}" - - name: Build container images include_tasks: build.yaml loop: "{{ container_images }}"