Merge "Add support for passing path to docker build"
This commit is contained in:
commit
d7c6c4e746
@ -63,6 +63,12 @@
|
||||
uploaded (it will be tagged with this in the local
|
||||
registry).
|
||||
|
||||
.. zuul:jobvar:: path
|
||||
|
||||
Optional; if supplied, the directory that should be passed to
|
||||
docker build. Useful for building images with a Dockerfile
|
||||
in the context directory but a source repository elsewhere.
|
||||
|
||||
abstract: true
|
||||
pre-run: playbooks/zuul/build-image/pre.yaml
|
||||
run: playbooks/zuul/build-image/run.yaml
|
||||
|
@ -1,7 +1,7 @@
|
||||
- hosts: all
|
||||
tasks:
|
||||
- name: Build a docker image
|
||||
command: "docker build . {{ target | default(false) | ternary('--target ', '') }}{{ target | default('') }} --tag {{ item.repository }}:change_{{ zuul.change }}"
|
||||
command: "docker build {{ item.path | default('.') }} -f Dockerfile {{ target | default(false) | ternary('--target ', '') }}{{ target | default('') }} --tag {{ item.repository }}:change_{{ zuul.change }}"
|
||||
args:
|
||||
chdir: "{{ zuul.project.src_dir }}/{{ item.context }}"
|
||||
loop: "{{ images }}"
|
||||
|
Loading…
Reference in New Issue
Block a user