diff --git a/backend/services/deploy.sh b/backend/services/deploy.sh index a3c3d0e6..cad50bba 100644 --- a/backend/services/deploy.sh +++ b/backend/services/deploy.sh @@ -256,25 +256,30 @@ status() { } health() { + # Format: "service-name:port:health-endpoint" local services=( - "identity-service:3000" - "wallet-service:3001" - "backup-service:3002" - "planting-service:3003" - "referral-service:3004" - "reward-service:3005" - "mpc-service:3006" - "leaderboard-service:3007" - "reporting-service:3008" - "authorization-service:3009" - "admin-service:3010" + "identity-service:3000:/api/v1/health" + "wallet-service:3001:/api/v1/health" + "backup-service:3002:/health" + "planting-service:3003:/api/v1/health" + "referral-service:3004:/api/v1/health" + "reward-service:3005:/health" + "mpc-service:3006:/api/v1/health" + "leaderboard-service:3007:/api/health" + "reporting-service:3008:/api/v1/health" + "authorization-service:3009:/api/v1/health" + "admin-service:3010:/api/v1/health" + "presence-service:3011:/api/v1/health" ) for svc in "${services[@]}"; do + # Parse service:port:endpoint name="${svc%%:*}" - port="${svc##*:}" + rest="${svc#*:}" + port="${rest%%:*}" + endpoint="${rest#*:}" - if curl -s -o /dev/null -w "%{http_code}" "http://localhost:$port/health" 2>/dev/null | grep -q "200"; then + if curl -s -o /dev/null -w "%{http_code}" "http://localhost:${port}${endpoint}" 2>/dev/null | grep -q "200"; then echo -e "${GREEN}[OK]${NC} $name (port $port)" else echo -e "${RED}[FAIL]${NC} $name (port $port)"