From 0bef13fbd732a33a352e45bc19b8c6ff5c7ef948 Mon Sep 17 00:00:00 2001 From: wangbo Date: Wed, 29 Jul 2026 02:56:50 +0800 Subject: [PATCH] =?UTF-8?q?fix(deploy):=20=E5=AE=8C=E6=95=B4=E8=AF=BB?= =?UTF-8?q?=E5=8F=96=E8=BE=B9=E7=BC=98=E9=AA=8C=E6=94=B6=E5=93=8D=E5=BA=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit OpenAPI 响应较大,curl 通过管道交给 grep -q 时会因下游提前退出报写端关闭,造成健康服务被误判失败。改为完整读取各响应后再断言内容。\n\n验证:bash -n、ShellCheck、git diff --check。 --- scripts/cluster/verify-cluster.sh | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/scripts/cluster/verify-cluster.sh b/scripts/cluster/verify-cluster.sh index ef327da..3f75306 100755 --- a/scripts/cluster/verify-cluster.sh +++ b/scripts/cluster/verify-cluster.sh @@ -115,14 +115,18 @@ REMOTE echo 'application_acceptance=PASS api=2 web=2 digests=pinned' for edge_ip in "${CLUSTER_NINGBO_HOST#*@}" "${CLUSTER_HONGKONG_HOST#*@}"; do - curl -fsS --max-time 10 --resolve "ai.51easyai.com:443:$edge_ip" \ - https://ai.51easyai.com/api/v1/healthz | grep -q easyai-ai-gateway - curl -fsS --max-time 10 --resolve "ai.51easyai.com:443:$edge_ip" \ - https://ai.51easyai.com/api/v1/readyz | grep -q '"ok":true' - curl -fsS --max-time 10 --resolve "ai.51easyai.com:443:$edge_ip" \ - https://ai.51easyai.com/api/v1/openapi.json | grep -q '"/api/v1/chat/completions"' - curl -fsS --max-time 10 --resolve "ai.51easyai.com:443:$edge_ip" \ - https://ai.51easyai.com/ | grep -q 'EasyAI AI Gateway' + health_body=$(curl -fsS --max-time 10 --resolve "ai.51easyai.com:443:$edge_ip" \ + https://ai.51easyai.com/api/v1/healthz) + grep -q easyai-ai-gateway <<<"$health_body" + ready_body=$(curl -fsS --max-time 10 --resolve "ai.51easyai.com:443:$edge_ip" \ + https://ai.51easyai.com/api/v1/readyz) + grep -q '"ok":true' <<<"$ready_body" + openapi_body=$(curl -fsS --max-time 10 --resolve "ai.51easyai.com:443:$edge_ip" \ + https://ai.51easyai.com/api/v1/openapi.json) + grep -q '"/api/v1/chat/completions"' <<<"$openapi_body" + web_body=$(curl -fsS --max-time 10 --resolve "ai.51easyai.com:443:$edge_ip" \ + https://ai.51easyai.com/) + grep -q 'EasyAI AI Gateway' <<<"$web_body" done echo 'nginx_edges=PASS ningbo=true hongkong=true dns_changed=false' fi