优化半自动更新功能,提升用户体验

This commit is contained in:
geht
2026-06-16 17:31:40 +08:00
parent c96833b339
commit 54a132de46

36
deploy-server.bat Normal file
View File

@@ -0,0 +1,36 @@
@echo off
setlocal
set SRC=D:\qhmes-src
set GIT="C:\Program Files\Git\cmd\git.exe"
set DEPLOY_DIR=D:\qhmes
set JAR_NAME=jeecg-system-start-3.9.2.jar
set SVC=D:\qhmes\qhmes-service.exe
set BUILT_JAR=%SRC%\jeecg-boot\jeecg-module-system\jeecg-system-start\target\%JAR_NAME%
echo [1/5] git pull ...
cd /d %SRC%
%GIT% pull
if errorlevel 1 ( echo [ERROR] git pull failed & pause & exit /b 1 )
echo [2/5] maven package with prod profile ...
cd /d %SRC%\jeecg-boot
call mvn clean package -pl jeecg-module-system/jeecg-system-start -am -DskipTests -P prod -T 1C
if errorlevel 1 ( echo [ERROR] build failed & pause & exit /b 1 )
if not exist "%BUILT_JAR%" ( echo [ERROR] built jar not found & pause & exit /b 1 )
echo [3/5] stop service ...
"%SVC%" stop
timeout /t 6 /nobreak >nul
echo [4/5] copy new jar ...
copy /Y "%BUILT_JAR%" "%DEPLOY_DIR%\%JAR_NAME%"
if errorlevel 1 ( echo [ERROR] copy failed, jar locked? & pause & exit /b 1 )
echo [5/5] start service ...
"%SVC%" start
echo.
echo ===== DEPLOY DONE =====
echo Check log: powershell -Command "Get-Content D:\qhmes\logs\qhmes-service.out.log -Wait -Tail 50"
endlocal
pause