commit | fbc591eee5e906a87582bb794dda3114876fc2ef | [log] [tgz] |
---|---|---|
author | Jan Kundrát <jan.kundrat@cesnet.cz> | Tue Feb 26 17:52:58 2019 +0100 |
committer | Jan Kundrát <jan.kundrat@cesnet.cz> | Tue Feb 26 17:52:58 2019 +0100 |
tree | 1fe9ea57d726e080b9bdc91128fa76338da2626a | |
parent | c8fd64e34b5356ce7621fd71fd63236bc5055ccb [diff] [blame] |
Job for promoting artifacts built during the last `check` pipeline run Change-Id: I5258040043ee97f3a682a23d94ccc053d477e3c3 Depends-on: https://gerrit.cesnet.cz/c/ci/project-config-public/+/1494 Depends-on: https://cesnet-gerrit-public/c/ci/project-config-public/+/1494 Depends-on: https://gerrit.cesnet.cz/c/ci/project-config-Czechlight-internal/+/1495 Depends-on: https://cesnet-gerrit-CzechLight/c/ci/project-config-Czechlight-internal/+/1495
diff --git a/roles/retrieve-artifacts-from-check/tasks/main.yaml b/roles/retrieve-artifacts-from-check/tasks/main.yaml new file mode 100644 index 0000000..ce10454 --- /dev/null +++ b/roles/retrieve-artifacts-from-check/tasks/main.yaml
@@ -0,0 +1,19 @@ +- fail: "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/logs/check_jobs_for_change.json + ALL_JOBS=$(jq -r '.[].job_name' < ~/zuul-output/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' < ~/check_jobs_for_change_ps) + mkdir ~/zuul-output/artifacts/${JOB_NAME} + pushd ~/zuul-output/artifacts/${JOB_NAME} + for ONE_URL in ${ARTIFACTS_URL}; do + echo "*** Found ${JOB_NAME}: ${ONE_URL}" + curl -O "${ONE_URL}" + done + popd + done +