diff --git a/roles/build-docker-image/tasks/buildx.yaml b/roles/build-docker-image/tasks/buildx.yaml index a72cea623..2fc2e695a 100644 --- a/roles/build-docker-image/tasks/buildx.yaml +++ b/roles/build-docker-image/tasks/buildx.yaml @@ -23,7 +23,9 @@ {% for label in zj_image.labels | default([]) -%} --label "{{ label }}" {% endfor %} - --label "org.zuul-ci.change={{ zuul.change }}" + {% if zuul.change | default(false) -%} + --label "org.zuul-ci.change={{ zuul.change }}" + {% endif -%} --label "org.zuul-ci.change_url={{ zuul.change_url }}" - name: Build images for all arches diff --git a/zuul-tests.d/container-roles-jobs.yaml b/zuul-tests.d/container-roles-jobs.yaml index 0280b51d0..650b67084 100644 --- a/zuul-tests.d/container-roles-jobs.yaml +++ b/zuul-tests.d/container-roles-jobs.yaml @@ -86,6 +86,19 @@ - name: builder label: ubuntu-bionic +- job: + name: zuul-jobs-test-build-docker-image-release-multiarch + parent: zuul-jobs-test-build-docker-image-release + description: | + Test building a docker image in a release pipeline. + + This job tests changes to the build-docker-image role using buildx, + simulating its use within a tag-based release pipeline. It is + not meant to be used directly but rather run on changes to roles + in the zuul-jobs repo. + vars: + multiarch: true + - job: name: zuul-jobs-test-registry-docker description: | @@ -378,6 +391,7 @@ - zuul-jobs-test-ensure-docker-ubuntu-bionic - zuul-jobs-test-ensure-docker-ubuntu-xenial - zuul-jobs-test-build-docker-image-release + - zuul-jobs-test-build-docker-image-release-multiarch - zuul-jobs-test-registry-docker - zuul-jobs-test-registry-docker-multiarch - zuul-jobs-test-registry-podman