blob: 48ef576b5b4e04e78c2f9a063a971d6ae09047b2 [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
Jan Kundrát3f9aa4b2019-06-05 23:25:38 +02005- name: Ensure artifacts directory exists
6 delegate_to: localhost
7 file:
8 path: "{{ zuul.executor.work_root }}/artifacts"
9 state: directory
10
Jan Kundrát1e38b3d2019-02-26 19:37:49 +010011- name: Retrieve artifacts built within the check pipeline
12 shell: |
13 set -ex
Jan Kundrát3f9aa4b2019-06-05 23:25:38 +020014 CHECKS_JSON={{ zuul.executor.work_root }}/check_jobs_for_change.json
15 curl "{{ zuul_root_url }}/api/tenant/{{ zuul.tenant }}/builds?pipeline=check&change={{ zuul.change }}&patchset={{ zuul.patchset }}" --output ${CHECKS_JSON}
16 ALL_JOBS=$(jq -r '.[].job_name' < ${CHECKS_JSON} | sort | uniq)
Jan Kundrát1e38b3d2019-02-26 19:37:49 +010017 for JOB_NAME in ${ALL_JOBS}; do
Jan Kundrát3f9aa4b2019-06-05 23:25:38 +020018 ARTIFACTS_URL=$(jq -r ". | map(select(.job_name == \"${JOB_NAME}\"))[0].artifacts[].url" < ${CHECKS_JSON})
19 mkdir {{ zuul.executor.work_root }}/artifacts/${JOB_NAME}
20 pushd {{ zuul.executor.work_root }}/artifacts/${JOB_NAME}
Jan Kundrát1e38b3d2019-02-26 19:37:49 +010021 for ONE_URL in ${ARTIFACTS_URL}; do
22 curl -O "${ONE_URL}"
23 done
24 popd
25 done
Jan Kundrát3f9aa4b2019-06-05 23:25:38 +020026 rm -f ${CHECKS_JSON}