fix(deploy): 修复 health 命令使用正确的健康检查端点

- 为每个微服务配置实际的健康检查端点路径
- 大多数服务使用 /api/v1/health
- backup-service 和 reward-service 使用 /health
- leaderboard-service 使用 /api/health
- 新增 presence-service (端口 3011)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Developer 2025-12-02 22:46:52 -08:00
parent 08485d361f
commit 784e98f1dc
1 changed files with 18 additions and 13 deletions

View File

@ -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)"