Merge "Add support for per-image build-arg settings"
This commit is contained in:
commit
dff34e57a7
@ -69,6 +69,10 @@
|
||||
docker build. Useful for building images with a Dockerfile
|
||||
in the context directory but a source repository elsewhere.
|
||||
|
||||
.. zuul:jobvar:: build_args
|
||||
|
||||
Optional; if supplied, a list of values to pass to the docker
|
||||
``--build-arg`` parameter.
|
||||
abstract: true
|
||||
pre-run: playbooks/zuul/build-image/pre.yaml
|
||||
run: playbooks/zuul/build-image/run.yaml
|
||||
|
@ -112,4 +112,4 @@ EXPOSE 22
|
||||
VOLUME ["/data"]
|
||||
ENTRYPOINT ["/usr/bin/entrypoint"]
|
||||
CMD ["/usr/sbin/sshd", "-D"]
|
||||
# this comment is here to perform a test run of the job....
|
||||
# this comment is here to perform a test run of the job.....
|
||||
|
@ -1,7 +1,15 @@
|
||||
- hosts: all
|
||||
tasks:
|
||||
- name: Build a docker image
|
||||
command: "docker build {{ item.path | default('.') }} -f Dockerfile {{ target | default(false) | ternary('--target ', '') }}{{ target | default('') }} --tag {{ item.repository }}:change_{{ zuul.change }}"
|
||||
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.project.src_dir }}/{{ item.context }}"
|
||||
loop: "{{ images }}"
|
||||
|
Loading…
x
Reference in New Issue
Block a user