Add support for passing env vars to the container build env

This is useful if you are using docker and wish to enable buildkit for
example.

Change-Id: I69ae90d945fa3f4eabc10460da936b23c8212858
This commit is contained in:
Clark Boylan 2023-03-22 10:36:18 -07:00 committed by James E. Blair
parent 40f9c38d0c
commit 13e44fa520
3 changed files with 8 additions and 0 deletions

View File

@ -165,4 +165,10 @@ using the roles described here.
added with each sibling project. Note that projects here must
be listed in ``required-projects``.
.. zuul:rolevar:: container_build_extra_env
:type: dict
A dictionary of key value pairs to add to the container build environment.
This may be useful to enable buildkit with docker builds for example.
.. _anchors: https://yaml.org/spec/1.2/spec.html#&%20anchor//

View File

@ -1,2 +1,3 @@
zuul_work_dir: "{{ zuul.project.src_dir }}"
container_command: podman
container_build_extra_env: {}

View File

@ -52,6 +52,7 @@
{% endfor -%}
args:
chdir: "{{ zuul_work_dir }}/{{ zj_image.context }}"
environment: "{{ container_build_extra_env }}"
- name: Cleanup sibling source directory
file: