ci: EdgeOne 境外部署加重试(构建节点到 api.edgeone.ai 偶发 15s 超时会被误报成令牌无效)
This commit is contained in:
1 parent
437cd339ad
commit
48a2fd697f
1 file changed
+15
-1
@@ -155,7 +155,21 @@
|
||||
trap record EXIT
|
||||
|
||||
test -n "$EDGEONE_API_TOKEN" || { echo "❌ 缺 EDGEONE_API_TOKEN"; exit 1; }
|
||||
npx edgeone pages deploy ./public -n hugo-blog -t "$EDGEONE_API_TOKEN" --area overseas
|
||||
# ★ 重试 3 次:EdgeOne CLI 第一步要访问 api.edgeone.ai 做 region 检查,
|
||||
# 构建节点到该域名的偶发超时(实测 15s AxiosError timeout)会让 CLI 直接
|
||||
# 报「Invalid EDGEONE_PAGES_API_TOKEN」—— 令牌其实没坏,纯网络抖动。
|
||||
# 2026-10-04 复现:同一令牌在本机部署秒过,CNB 节点那一次 15s 超时误报。
|
||||
# 失败重试比让整条流水线变红、白发一封失败邮件划算得多。
|
||||
ok_deploy=0
|
||||
for i in 1 2 3; do
|
||||
if npx edgeone pages deploy ./public -n hugo-blog -t "$EDGEONE_API_TOKEN" --area overseas; then
|
||||
ok_deploy=1
|
||||
break
|
||||
fi
|
||||
echo "⚠️ EdgeOne 第 $i 次部署失败(多为构建节点网络抖动),20s 后重试…"
|
||||
sleep 20
|
||||
done
|
||||
test "$ok_deploy" = 1 || { echo "❌ EdgeOne 连续 3 次部署失败"; exit 1; }
|
||||
echo "✅ EdgeOne 部署完成"
|
||||
|
||||
- name: 上报部署状态
|
||||
|
||||
Reference in new issue
Block a user