fix: 部署脚本 worker health-cmd 未转义导致 staging 部署失败回滚 #1806
Reference in New Issue
Block a user
Delete Branch "fix/deploy-script-pid-escape"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
问题
staging 部署流水线 Deploy Staging job 失败,所有新版本镜像拉取成功后,容器启动阶段报错并自动回滚:
根因
scripts/ci_staging_deploy.sh开启了set -eu。worker 容器的--health-cmd使用双引号包裹:其中的 $pid 被外层部署脚本在
docker run参数展开阶段提前求值。pid在该作用域未定义,set -u下直接报parameter not set并终止,worker 容器未创建 → 部署判定失败 → 回滚到旧版本。该 health-cmd 是 #1803 周期 Worker 健康检查修复(commit e4ac3983)引入。
修复
将 health-cmd 内
$pid转义为\$pid,透传到容器内由 healthcheck shell 展开:此修复同时解除 #1805(AI数字人 v3)合入后的 staging 部署阻塞。
🤖 Generated with Claude Code
🚀 预览环境已部署
🗑️ 预览环境已清理
PR #1806 已关闭或合并,对应的预览环境已被清理。