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 }}"