ci(deploy): poll service readiness instead of fixed 3s sleep
is-active after sleep 3 false-fails when the unit is still activating (e.g. Next standalone boot >3s) — exit 3 flagged the deploy red even though the service came up fine. Poll is-active up to 30s and only fail if it never reaches 'active'.
This commit is contained in:
@@ -118,8 +118,9 @@ jobs:
|
||||
echo "=== Updating profile ==="
|
||||
ssh "$VPS_USER@$VPS_HOST" "sudo /nix/var/nix/profiles/default/bin/nix-env --profile /nix/var/nix/profiles/gmw-${{ matrix.service }} --set '$STORE_PATH'"
|
||||
|
||||
echo "=== Restarting service ==="
|
||||
ssh "$VPS_USER@$VPS_HOST" "sudo systemctl daemon-reload && sudo systemctl restart gmw-${{ matrix.service }} && sleep 3 && sudo systemctl is-active gmw-${{ matrix.service }}"
|
||||
echo "=== Restarting service ===\n"
|
||||
ssh "$VPS_USER@$VPS_HOST" \
|
||||
"sudo systemctl daemon-reload && sudo systemctl restart gmw-${{ matrix.service }} && for i in \$(seq 1 15); do state=\$(sudo systemctl is-active gmw-${{ matrix.service }} 2>/dev/null || echo inactive); [ \"\$state\" = \"active\" ] && break; sleep 2; done; echo \"final-state=\$state\"; [ \"\$state\" = \"active\" ]"
|
||||
echo "✅ gmw-${{ matrix.service }} deployed"
|
||||
|
||||
cleanup:
|
||||
|
||||
Reference in New Issue
Block a user