zuul-jobs/roles/nebulous-promote-container-image/tasks/promote-from-intermediate-registry.yaml
jmarchel 5464c4c413 Add promote container images role
Change-Id: I8ef9ae344e65d8c63b2cf72ec756960b65d44413
2023-12-21 14:58:31 +01: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