From a15590854df35eef961d8d069145545068e0a984 Mon Sep 17 00:00:00 2001 From: azlam-salam Date: Mon, 8 Sep 2025 19:58:50 +1000 Subject: [PATCH] fix: fix health check using status --- .github/workflows/deploy-server.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/deploy-server.yml b/.github/workflows/deploy-server.yml index 08dfdfd..7ca5ce1 100644 --- a/.github/workflows/deploy-server.yml +++ b/.github/workflows/deploy-server.yml @@ -140,13 +140,13 @@ jobs: SSH_USER="${{ vars.SSH_USER || 'root' }}" # Wait for services to be ready - timeout 300 bash -c 'until sfp server health --tenant "'"$TENANT"'" --ssh-connection "'"$SSH_USER@$SSH_HOST"'" --identity-file ~/.ssh/deploy_key; do sleep 5; done' + timeout 300 bash -c 'until sfp server status --tenant "'"$TENANT"'" --ssh-connection "'"$SSH_USER@$SSH_HOST"'" --identity-file ~/.ssh/deploy_key --json | grep -A 100 "^{$" | jq -e "all(.result.services[]; .state == \"running\")" > /dev/null; do sleep 5; done' - # Detailed health check - HEALTH_STATUS=$(sfp server health --tenant "$TENANT" --ssh-connection "$SSH_USER@$SSH_HOST" --identity-file ~/.ssh/deploy_key --json) + # Detailed status check + STATUS_RESULT=$(sfp server status --tenant "$TENANT" --ssh-connection "$SSH_USER@$SSH_HOST" --identity-file ~/.ssh/deploy_key --json | grep -A 100 "^{$") - if echo "$HEALTH_STATUS" | jq -e '.healthy == true' > /dev/null; then - echo "✅ Server is healthy after deployment" + if echo "$STATUS_RESULT" | jq -e 'all(.result.services[]; .state == "running")' > /dev/null; then + echo "✅ All services are running after deployment" echo "healthy=true" >> $GITHUB_OUTPUT # Get new version @@ -154,7 +154,7 @@ jobs: echo "new_version=$NEW_VERSION" >> $GITHUB_OUTPUT echo "📦 New version: $NEW_VERSION" else - echo "❌ Server health check failed" + echo "❌ Some services are not running" echo "healthy=false" >> $GITHUB_OUTPUT exit 1 fi