workflows/deploy: Improve update verification check
Build and test / build (push) Successful in 1m4s
Build and test / test (push) Successful in 18s
Build and test / deploy (push) Failing after 21s

This commit is contained in:
2026-02-07 23:27:52 +01:00
parent 4d56238ee3
commit 98e3e326e4
+11 -2
View File
@@ -97,7 +97,7 @@ jobs:
- name: Replace placeholder serial
run: |
SERIAL_OLD="$(dig +short SOA pvv.ntnu.no | cut -d" " -f3)"
SERIAL_OLD="$(dig +short "@${{ vars.SSH_HOST }}" SOA pvv.ntnu.no | cut -d" " -f3)"
if [[ -z "$SERIAL_OLD" || ! "$SERIAL_OLD" =~ ^[0-9]+$ || $SERIAL_OLD -lt 1970010101 || $SERIAL_OLD -gt 3000000000 ]]; then
echo "Error: SERIAL_OLD='$SERIAL_OLD' does not look reasonable"
exit 1
@@ -110,6 +110,7 @@ jobs:
else
SERIAL_NEW="${DATE}01"
fi
echo "$SERIAL_NEW" > /tmp/serial_new
SERIAL_PLACEHOLDER=1970010101
@@ -154,4 +155,12 @@ jobs:
ssh targethost "doas /usr/sbin/nsd-control reload"
- name: Verifying operation
run: dig "@${{ vars.SSH_HOST }}" SOA pvv.ntnu.no
run: |
SERIAL_ACTIVE="$(dig "@${{ vars.SSH_HOST }}" SOA pvv.ntnu.no | cut -d" " -f3)"
if [[ "$(cat /tmp/serial_new)" == "$SERIAL_ACTIVE" ]]
then
echo "Update successful, server reports new active serial number '$SERIAL_ACTIVE'"
else
echo "Update failed, server reports serial '$SERIAL_ACTIVE' instead of new serial '$(cat /tmp/serial_new)'"
exit 1
fi