blob: 75d490c6aa583875c55a48a5fff3447463cc1c8c [file] [log] [blame]
Jan Kundrát1e38b3d2019-02-26 19:37:49 +01001- fail:
2 msg: "This job only works in the 'promote' pipeline."
3 when: zuul.pipeline != 'promote'
4
5- name: Retrieve artifacts built within the check pipeline
6 shell: |
7 set -ex
8 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
9 ALL_JOBS=$(jq -r '.[].job_name' < {{ zuul_output_dir }}/logs/check_jobs_for_change.json | sort | uniq)
10 for JOB_NAME in ${ALL_JOBS}; do
11 ARTIFACTS_URL=$(jq -r ". | map(select(.job_name == \"${JOB_NAME}\"))[0].artifacts[].url" < {{ zuul_output_dir }}/logs/check_jobs_for_change.json)
12 mkdir {{ zuul_output_dir }}/artifacts/${JOB_NAME}
13 pushd {{ zuul_output_dir }}/artifacts/${JOB_NAME}
14 for ONE_URL in ${ARTIFACTS_URL}; do
15 curl -O "${ONE_URL}"
16 done
17 popd
18 done