fix(cd): Use Python httpx for health check instead of curl
- Container uses python:3.11-slim without curl - httpx is already installed as API dependency - Fixes: "curl: executable file not found in $PATH" Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
4
.github/workflows/cd.yaml
vendored
4
.github/workflows/cd.yaml
vendored
@@ -236,8 +236,8 @@ jobs:
|
||||
run: |
|
||||
sleep 15
|
||||
API_POD=$(kubectl get pods -n awoooi-prod -l app=awoooi-api -o jsonpath='{.items[0].metadata.name}')
|
||||
# 指定容器名稱避免 "container not found" 錯誤
|
||||
kubectl exec -n awoooi-prod $API_POD -c api -- curl -sf http://localhost:8000/api/v1/health || echo "Health check failed but deployment succeeded"
|
||||
# 使用 Python httpx (容器沒有 curl,但有 httpx)
|
||||
kubectl exec -n awoooi-prod $API_POD -c api -- python -c "import httpx; r=httpx.get('http://localhost:8000/api/v1/health', timeout=5); print(r.status_code)" || echo "Health check failed but deployment succeeded"
|
||||
|
||||
- name: Notify OpenClaw
|
||||
if: always()
|
||||
|
||||
Reference in New Issue
Block a user