Fix and test multiarch docker builds in a release pipeline

This corrects the following error when upload-docker-image is
used in a release pipeline:

  The task includes an option with an undefined variable.
  The error was: 'dict object' has no attribute 'change'

Change-Id: I70cd566ddd0b931d635b20107d652f3591a133b6
This commit is contained in:
James E. Blair 2020-06-19 11:26:36 -07:00
parent 0f55195335
commit ce000177f8
2 changed files with 17 additions and 1 deletions

View File

@ -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

View File

@ -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