fix(deploy): 修复数据库初始化复用旧镜像
This commit is contained in:
+7
-1
@@ -325,7 +325,13 @@ run_compose_config() {
|
||||
|
||||
run_backend_init() {
|
||||
step "初始化数据库与管理员账号"
|
||||
ctms_run_quiet "运行 backend-init 容器" -- compose_cmd run --rm backend-init
|
||||
if [[ "$SKIP_BUILD" -eq 1 ]]; then
|
||||
ctms_run_quiet "运行 backend-init 容器" -- compose_cmd run --rm backend-init
|
||||
else
|
||||
# backend-init 是 profile 服务,不会被后续 `compose up --build` 自动构建。
|
||||
# 更新部署时必须先基于当前代码重建,否则会复用旧镜像并缺失新 Alembic revision。
|
||||
CTMS_LIVE_OUTPUT=1 ctms_run_quiet "构建并运行 backend-init 容器" -- compose_cmd run --rm --build backend-init
|
||||
fi
|
||||
}
|
||||
|
||||
run_build_and_start() {
|
||||
|
||||
Reference in New Issue
Block a user