From 8af02774d019b4fa0a766238bc45864dedc8ff2b Mon Sep 17 00:00:00 2001 From: chakcy <947105045@qq.com> Date: Wed, 29 Apr 2026 11:46:46 +0800 Subject: [PATCH] =?UTF-8?q?modify:=20=E4=BF=AE=E6=94=B9=20deploy.sh=20?= =?UTF-8?q?=E4=B8=AD=E7=9A=84=E6=A8=A1=E6=9D=BF=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- {{ cookiecutter.project_name }}/deploy.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/{{ cookiecutter.project_name }}/deploy.sh b/{{ cookiecutter.project_name }}/deploy.sh index fb34dde..3b81874 100644 --- a/{{ cookiecutter.project_name }}/deploy.sh +++ b/{{ cookiecutter.project_name }}/deploy.sh @@ -31,7 +31,7 @@ if ! docker image inspect "$IMAGE" &> /dev/null; then fi # 1. 停止并删除旧容器 -if docker ps -a --format '{{.Names}}' | grep -q "^${CONTAINER}$"; then +{% raw %}if docker ps -a --format '{{.Names}}' | grep -q "^${CONTAINER}$"; then{% endraw %} log_warn "发现旧容器,正在停止并删除..." docker stop "$CONTAINER" 2>/dev/null || true docker rm "$CONTAINER" 2>/dev/null || true @@ -76,7 +76,7 @@ log_info "等待应用启动..." sleep 3 # 6. 检查状态 -if docker ps --format '{{.Names}}' | grep -q "^${CONTAINER}$"; then +{% raw %}if docker ps --format '{{.Names}}' | grep -q "^${CONTAINER}$"; then{% endraw %} log_info "==========================================" log_info "✅ 部署成功!" log_info "=========================================="