fix(deploy): 完整读取边缘验收响应
OpenAPI 响应较大,curl 通过管道交给 grep -q 时会因下游提前退出报写端关闭,造成健康服务被误判失败。改为完整读取各响应后再断言内容。\n\n验证:bash -n、ShellCheck、git diff --check。
This commit is contained in:
@@ -115,14 +115,18 @@ REMOTE
|
|||||||
echo 'application_acceptance=PASS api=2 web=2 digests=pinned'
|
echo 'application_acceptance=PASS api=2 web=2 digests=pinned'
|
||||||
|
|
||||||
for edge_ip in "${CLUSTER_NINGBO_HOST#*@}" "${CLUSTER_HONGKONG_HOST#*@}"; do
|
for edge_ip in "${CLUSTER_NINGBO_HOST#*@}" "${CLUSTER_HONGKONG_HOST#*@}"; do
|
||||||
curl -fsS --max-time 10 --resolve "ai.51easyai.com:443:$edge_ip" \
|
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
|
https://ai.51easyai.com/api/v1/healthz)
|
||||||
curl -fsS --max-time 10 --resolve "ai.51easyai.com:443:$edge_ip" \
|
grep -q easyai-ai-gateway <<<"$health_body"
|
||||||
https://ai.51easyai.com/api/v1/readyz | grep -q '"ok":true'
|
ready_body=$(curl -fsS --max-time 10 --resolve "ai.51easyai.com:443:$edge_ip" \
|
||||||
curl -fsS --max-time 10 --resolve "ai.51easyai.com:443:$edge_ip" \
|
https://ai.51easyai.com/api/v1/readyz)
|
||||||
https://ai.51easyai.com/api/v1/openapi.json | grep -q '"/api/v1/chat/completions"'
|
grep -q '"ok":true' <<<"$ready_body"
|
||||||
curl -fsS --max-time 10 --resolve "ai.51easyai.com:443:$edge_ip" \
|
openapi_body=$(curl -fsS --max-time 10 --resolve "ai.51easyai.com:443:$edge_ip" \
|
||||||
https://ai.51easyai.com/ | grep -q 'EasyAI AI Gateway'
|
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
|
done
|
||||||
echo 'nginx_edges=PASS ningbo=true hongkong=true dns_changed=false'
|
echo 'nginx_edges=PASS ningbo=true hongkong=true dns_changed=false'
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user