fix(update): 重启所有运行中的业务服务而非仅 tenant-service
原脚本只重启 tenant-service 和 nginx,导致 im-service/file-service 等 服务的镜像更新不生效。改为遍历所有可能的业务服务,按实际运行状态 决定是否重启,跳过未激活的可选服务。 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
这个提交包含在:
父节点
34bfa71bd5
当前提交
dd1daaaae9
@ -447,13 +447,14 @@ _COMPOSE="docker compose --env-file ${ROOT_DIR}/.env \
|
||||
|
||||
# 使用 up -d 而非 restart:restart 只重启容器进程,不会切换到新拉取的镜像;
|
||||
# up -d 会检测镜像变更并重建容器,是应用新版本的正确方式。
|
||||
info "应用新镜像并重启 tenant-service ..."
|
||||
$_COMPOSE up -d --no-deps --remove-orphans tenant-service
|
||||
ok "tenant-service 已更新"
|
||||
|
||||
info "应用新镜像并重启 nginx ..."
|
||||
$_COMPOSE up -d --no-deps --remove-orphans nginx
|
||||
ok "nginx 已更新"
|
||||
for _svc in tenant-service im-service file-service update-service license-service push-service tenant-web nginx; do
|
||||
# 仅重启已激活的服务(跳过未运行的可选服务)
|
||||
if $_COMPOSE ps --services --filter status=running 2>/dev/null | grep -q "^${_svc}$"; then
|
||||
info "应用新镜像并重启 ${_svc} ..."
|
||||
$_COMPOSE up -d --no-deps --remove-orphans "$_svc"
|
||||
ok "${_svc} 已更新"
|
||||
fi
|
||||
done
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# Step 7 — 等待 tenant-service 健康
|
||||
|
||||
正在加载...
在新工单中引用
屏蔽一个用户