run.sh (1555B)
1 #!/bin/bash 2 3 set -ex 4 5 SHA256SUMS="SHA256SUMS.zip" 6 7 function get_route() 8 { 9 local task_url="${TASKCLUSTER_ROOT_URL}/api/queue/v1/task/${TASK_ID}" 10 local payload 11 payload=$(curl -sSL "${task_url}") 12 13 local route 14 route=$(echo "${payload}" | jq -r '.routes[] | select(contains("latest")) | select(contains("pushdate") | not) ' | sed -e 's/^index\.//') 15 echo "${route}" 16 } 17 18 function get_sha256sum_url() 19 { 20 local route 21 route=$(get_route) 22 local sha256sums_url="${TASKCLUSTER_ROOT_URL}/api/index/v1/task/${route}/artifacts/public/build/${SHA256SUMS}" 23 echo "${sha256sums_url}" 24 } 25 26 function has_sha256sums_on_index() 27 { 28 local url 29 url=$(get_sha256sum_url) 30 curl -sSL --head --fail -o /dev/null "${url}" 31 } 32 33 function download_extract_sha256sums() 34 { 35 local url=$1 36 curl -sSL "${url}" -o "${SHA256SUMS}" 37 unzip "${SHA256SUMS}" && rm "${SHA256SUMS}" 38 } 39 40 if has_sha256sums_on_index; then 41 sha256=$(get_sha256sum_url) 42 fi 43 44 mkdir -p /builds/worker/artifacts/ 45 46 pushd "${MOZ_FETCHES_DIR}/symbol-scrapers/windows-graphics-drivers" 47 if [ -z "${sha256}" ]; then 48 touch SHA256SUMS # First run, create the file 49 else 50 download_extract_sha256sums "${sha256}" 51 fi 52 53 PATH="${MOZ_FETCHES_DIR}/7zz/:${MOZ_FETCHES_DIR}/cabextract/:${PATH}" DUMP_SYMS="${MOZ_FETCHES_DIR}/dump_syms/dump_syms" /bin/bash -x script.sh 54 zip -r9 "/builds/worker/artifacts/${SHA256SUMS}" SHA256SUMS 55 popd 56 57 zip_files=$(find /builds/worker/artifacts -name "target.crashreporter-symbols.*.zip") 58 59 if [ -z "${zip_files}" ]; then 60 echo "No symbols zip produced, upload task will fail" 61 fi