fix(deploy): auto-restart services after rebuild
Rebuild command now automatically restarts the service(s) to use the newly built image. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
8e2c44edd0
commit
45a594d39a
10
deploy.sh
10
deploy.sh
|
|
@ -604,6 +604,10 @@ do_rebuild() {
|
||||||
if [ "$target" = "all" ]; then
|
if [ "$target" = "all" ]; then
|
||||||
log_step "重新构建所有服务镜像 (--no-cache)..."
|
log_step "重新构建所有服务镜像 (--no-cache)..."
|
||||||
$DOCKER_COMPOSE build --no-cache
|
$DOCKER_COMPOSE build --no-cache
|
||||||
|
|
||||||
|
# 重启所有后端服务
|
||||||
|
log_step "重启所有后端服务..."
|
||||||
|
$DOCKER_COMPOSE up -d user-service payment-service knowledge-service conversation-service evolution-service
|
||||||
else
|
else
|
||||||
# 获取服务名
|
# 获取服务名
|
||||||
local service_name=""
|
local service_name=""
|
||||||
|
|
@ -620,9 +624,13 @@ do_rebuild() {
|
||||||
|
|
||||||
log_step "重新构建 $target 镜像 (--no-cache)..."
|
log_step "重新构建 $target 镜像 (--no-cache)..."
|
||||||
$DOCKER_COMPOSE build --no-cache "$service_name"
|
$DOCKER_COMPOSE build --no-cache "$service_name"
|
||||||
|
|
||||||
|
# 重启服务使用新镜像
|
||||||
|
log_step "重启 $target 服务..."
|
||||||
|
$DOCKER_COMPOSE up -d "$service_name"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
log_success "镜像重新构建完成"
|
log_success "镜像重新构建并重启完成"
|
||||||
}
|
}
|
||||||
|
|
||||||
# 启动入口
|
# 启动入口
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue