push-to-intermediate-registry: look for container_images variable

When used with the container-image roles, the variable is
container_images, not docker_images.

Change-Id: I074f9523aea7d71879f722b88ff7c3e7e45fb90f
This commit is contained in:
Ian Wienand 2023-03-24 10:30:26 +11:00
parent b9799f0c7f
commit d1e74606bc
No known key found for this signature in database
3 changed files with 19 additions and 3 deletions

View File

@ -1,7 +1,8 @@
Push artifacts to the intermediate registry Push artifacts to the intermediate registry
This role will push any images built by This role will push any images built by
:zuul:role:`build-docker-image` into an intermediate registry. :zuul:role:`build-docker-image` or :zuul:role:`build-container-image`
into an intermediate registry.
Run this in a trusted post-playbook at the end of a job after the Run this in a trusted post-playbook at the end of a job after the
image build. image build.
@ -73,3 +74,18 @@ registry operating for the use of Zuul, and it requires "skopeo" and
:default: ['latest'] :default: ['latest']
A list of tags to be added to the image. A list of tags to be added to the image.
.. zuul:rolevar:: container_images
:type: list
A list of images built. Each item in the list should have:
.. zuul:rolevar:: repository
The name of the target repository for the image.
.. zuul:rolevar:: tags
:type: list
:default: ['latest']
A list of tags to be added to the image.

View File

@ -1,5 +1,5 @@
- name: Push images to intermediate registry - name: Push images to intermediate registry
when: when:
- docker_images is defined - (docker_images is defined) or (container_images is defined)
- zuul_success | default(true) | bool - zuul_success | default(true) | bool
include_tasks: push.yaml include_tasks: push.yaml

View File

@ -88,7 +88,7 @@
block: block:
- name: Push image to intermediate registry - name: Push image to intermediate registry
include_tasks: push-image.yaml include_tasks: push-image.yaml
loop: "{{ docker_images }}" loop: "{{ docker_images if docker_images is defined else container_images }}"
loop_control: loop_control:
loop_var: zj_image loop_var: zj_image
always: always: