zuul-jobs/roles/promote-container-image/tasks/promote-from-intermediate-registry.yaml
James E. Blair f381cc328b Update promote-container-image to copy from intermediate registry
Change-Id: Ia24bbd101e01ab371ceacfed006b5ff806418a97
2023-04-12 11:36:26 -07:00

22 lines
688 B
YAML

- name: Query Zuul API for image information
uri:
url: "{{ promote_container_image_api }}/builds?{{ promote_container_image_query }}"
register: build
- name: Parse build response
set_fact:
build: "{{ build.json[0] }}"
- name: Map image artifacts
set_fact:
zj_artifact_map: "{{ zj_artifact_map | default({}) | combine({zj_map_item.metadata.repository + ':' + zj_map_item.metadata.tag: zj_map_item.url}) }}"
loop_control:
loop_var: zj_map_item
loop: "{{ build | json_query(\"artifacts[?metadata.type=='container_image']\")}}"
- name: Promote image
loop: "{{ container_images }}"
loop_control:
loop_var: zj_image
include_tasks: promote-registry.yaml