diff --git a/roles/push-to-intermediate-registry/README.rst b/roles/push-to-intermediate-registry/README.rst index 93a2a6ee4..dfc249a7f 100644 --- a/roles/push-to-intermediate-registry/README.rst +++ b/roles/push-to-intermediate-registry/README.rst @@ -1,7 +1,8 @@ Push artifacts to the intermediate registry 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 image build. @@ -73,3 +74,18 @@ registry operating for the use of Zuul, and it requires "skopeo" and :default: ['latest'] 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. diff --git a/roles/push-to-intermediate-registry/tasks/main.yaml b/roles/push-to-intermediate-registry/tasks/main.yaml index 5bf1baabf..be108bcf2 100644 --- a/roles/push-to-intermediate-registry/tasks/main.yaml +++ b/roles/push-to-intermediate-registry/tasks/main.yaml @@ -1,5 +1,5 @@ - name: Push images to intermediate registry when: - - docker_images is defined + - (docker_images is defined) or (container_images is defined) - zuul_success | default(true) | bool include_tasks: push.yaml diff --git a/roles/push-to-intermediate-registry/tasks/push.yaml b/roles/push-to-intermediate-registry/tasks/push.yaml index a4e4a143d..edd48784e 100644 --- a/roles/push-to-intermediate-registry/tasks/push.yaml +++ b/roles/push-to-intermediate-registry/tasks/push.yaml @@ -88,7 +88,7 @@ block: - name: Push image to intermediate registry include_tasks: push-image.yaml - loop: "{{ docker_images }}" + loop: "{{ docker_images if docker_images is defined else container_images }}" loop_control: loop_var: zj_image always: