| - fail: |
| msg: "This job only works in the 'promote' pipeline." |
| when: zuul.pipeline != 'promote' |
| |
| - name: Retrieve artifacts built within the check pipeline |
| shell: | |
| set -ex |
| curl "https://zuul.gerrit.cesnet.cz/api/tenant/{{ zuul.tenant }}/builds?pipeline=check&change={{ zuul.change }}&patchset={{ zuul.patchset }}" --output {{ zuul_output_dir }}/logs/check_jobs_for_change.json |
| ALL_JOBS=$(jq -r '.[].job_name' < {{ zuul_output_dir }}/logs/check_jobs_for_change.json | sort | uniq) |
| for JOB_NAME in ${ALL_JOBS}; do |
| ARTIFACTS_URL=$(jq -r ". | map(select(.job_name == \"${JOB_NAME}\"))[0].artifacts[].url" < {{ zuul_output_dir }}/logs/check_jobs_for_change.json) |
| mkdir {{ zuul_output_dir }}/artifacts/${JOB_NAME} |
| pushd {{ zuul_output_dir }}/artifacts/${JOB_NAME} |
| for ONE_URL in ${ARTIFACTS_URL}; do |
| curl -O "${ONE_URL}" |
| done |
| popd |
| done |