fix(check-deployment): add some error handling and fix the "one-node" mode
All checks were successful
build configuration / build_web02 (push) Successful in 1m5s
build configuration / build_rescue01 (push) Successful in 1m5s
build configuration / build_vault01 (push) Successful in 1m7s
build configuration / build_storage01 (push) Successful in 1m11s
build configuration / build_compute01 (push) Successful in 1m16s
lint / check (push) Successful in 21s
build configuration / build_web01 (push) Successful in 1m31s

This commit is contained in:
sinavir 2024-02-23 17:35:25 +01:00
parent d1326f3f06
commit d55faceefb

View file

@ -88,14 +88,23 @@ echo "$RESULTS" | @jq@/bin/jq -c '.[]' |
while IFS=$'\n' read -r c; do
machine=$(echo "$c" | @jq@/bin/jq -r '.machine')
if [[ -n ${node-} ]] && [[ "$machine" != "$node" ]]; then
echo "Skipping ${machine}"
continue
fi
expected_path=$(echo "$c" | @jq@/bin/jq -r '.path')
domain=$(echo "$c" | @jq@/bin/jq -r '.domain')
drv_path=$(echo "$c" | @jq@/bin/jq -r '.drv')
current_path=$(retrieve_current_system "$domain")
err=0
current_path=$(retrieve_current_system "$domain") || err=1
if [[ "1" == "${err}" ]] ; then
echo "❌ failed to contact $domain !"
continue
fi
if [ "$expected_path" == "$current_path" ] ; then
echo "$machine -> OK"
echo "$machine -> OK"
elif [[ -n ${diff-} ]] ; then
nix-copy-closure --from "root@$domain" "$current_path"
nix-store -r "$drv_path"
@ -103,7 +112,7 @@ while IFS=$'\n' read -r c; do
@nvd@/bin/nvd diff "$expected_path" "$current_path"
return_status=1
else
echo "$machine -> error:"
echo "☠️ $machine -> error:"
echo " - Expected system: $expected_path"
echo " - Current system: $current_path"
return_status=1