优化半自动更新功能,修复已知问题并增强稳定性
This commit is contained in:
27
deploy-frontend.bat
Normal file
27
deploy-frontend.bat
Normal file
@@ -0,0 +1,27 @@
|
||||
@echo off
|
||||
setlocal
|
||||
set SRC=D:\qhmes-src
|
||||
set GIT="C:\Program Files\Git\cmd\git.exe"
|
||||
set WEB=D:\qhmes\nginx-1.30.1\html\jeecg
|
||||
set NGINX_DIR=D:\qhmes\nginx-1.30.1
|
||||
|
||||
echo [1/3] git pull ...
|
||||
cd /d %SRC%
|
||||
%GIT% pull
|
||||
if errorlevel 1 ( echo [ERROR] git pull failed & pause & exit /b 1 )
|
||||
if not exist "%SRC%\web-dist\index.html" ( echo [ERROR] web-dist not found in repo, run build-frontend.bat first & pause & exit /b 1 )
|
||||
|
||||
echo [2/3] replace nginx frontend files ...
|
||||
if exist "%WEB%" rmdir /S /Q "%WEB%"
|
||||
mkdir "%WEB%"
|
||||
xcopy "%SRC%\web-dist\*" "%WEB%\" /E /Y /I >nul
|
||||
if errorlevel 1 ( echo [ERROR] copy failed & pause & exit /b 1 )
|
||||
|
||||
echo [3/3] reload nginx (ignore error if nginx not running) ...
|
||||
cd /d %NGINX_DIR%
|
||||
nginx.exe -s reload
|
||||
|
||||
echo.
|
||||
echo ===== FRONTEND DEPLOY DONE =====
|
||||
endlocal
|
||||
pause
|
||||
Reference in New Issue
Block a user