zuul-jobs/roles/build-docker-image/tasks/main.yaml

14 lines
438 B
YAML

- name: Build a docker image
command: >-
docker build {{ item.path | default('.') }} -f Dockerfile
{% if target | default(false) -%}
--target {{ target }}
{% endif -%}
{% for build_arg in item.build_args | default([]) -%}
--build-arg {{ build_arg }}
{% endfor -%}
--tag {{ item.repository }}:change_{{ zuul.change }}
args:
chdir: "{{ zuul_work_dir }}/{{ item.context }}"
loop: "{{ images }}"