2021-11-30 17:32:40 +01:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
set -euo pipefail
|
|
|
|
# set -x
|
|
|
|
|
|
|
|
|
|
|
|
# mapfile BUILDS_FOR_LATEST_EVAL < <(
|
|
|
|
# curl -H 'Accept: application/json' https://hydra.nixos.org/jobset/nix/master/evals | \
|
|
|
|
# jq -r '.evals[0].builds[] | @sh')
|
|
|
|
BUILDS_FOR_LATEST_EVAL=$(
|
|
|
|
curl -sS -H 'Accept: application/json' https://hydra.nixos.org/jobset/nix/master/evals | \
|
|
|
|
jq -r '.evals[0].builds[]')
|
|
|
|
|
|
|
|
someBuildFailed=0
|
|
|
|
|
|
|
|
for buildId in $BUILDS_FOR_LATEST_EVAL; do
|
2022-04-06 13:34:25 +02:00
|
|
|
buildInfo=$(curl --fail -sS -H 'Accept: application/json' "https://hydra.nixos.org/build/$buildId")
|
2021-11-30 17:32:40 +01:00
|
|
|
|
2022-02-10 21:15:07 +01:00
|
|
|
finished=$(echo "$buildInfo" | jq -r '.finished')
|
|
|
|
|
|
|
|
if [[ $finished = 0 ]]; then
|
|
|
|
continue
|
|
|
|
fi
|
|
|
|
|
|
|
|
buildStatus=$(echo "$buildInfo" | jq -r '.buildstatus')
|
2021-11-30 17:32:40 +01:00
|
|
|
|
2022-02-10 11:10:29 +01:00
|
|
|
if [[ $buildStatus != 0 ]]; then
|
2021-11-30 17:32:40 +01:00
|
|
|
someBuildFailed=1
|
2022-02-10 11:10:29 +01:00
|
|
|
echo "Job “$(echo "$buildInfo" | jq -r '.job')” failed on hydra: $buildInfo"
|
2021-11-30 17:32:40 +01:00
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
|
|
|
exit "$someBuildFailed"
|