diff --git a/jobs/Deploy_CHM_DEV_115/config.xml b/jobs/Deploy_CHM_DEV_115/config.xml index d8ee9b0fc42b952e89ee64be9b08c43c4df6fc8e..047c4e3af5219131aca5a3e826af6530f5b90e01 100644 --- a/jobs/Deploy_CHM_DEV_115/config.xml +++ b/jobs/Deploy_CHM_DEV_115/config.xml @@ -4,12 +4,12 @@ false - + ylhealth - 2 + -1 5 -1 -1 @@ -83,32 +83,35 @@ - + + + - - REM 取得今天的年、月、日 (自動補零) -SETLOCAL EnableDelayedExpansion - -for /f "skip=1 tokens=1-6 delims= " %%a in ('wmic path Win32_LocalTime Get Day^,Hour^,Minute^,Month^,Second^,Year /Format:table') do ( - IF NOT "%%~f"=="" ( - set /a FormattedDate=10000 * %%f + 100 * %%d + %%a - set FormattedDate=%%f!FormattedDate:~-4,2!!FormattedDate:~-2,2!_%%b:%%c - ) -) -for /f "tokens=*" %%i in ('git rev-parse --short HEAD') do set VAR=%%i_%FormattedDate% -"C:\Program Files\Git\usr\bin\sed" -i "s/<title.*/<title ng-bind='page_title'>CRM v%VAR%<\/title\/>/" src\main\resources\static\index.html -"C:\Program Files\Git\usr\bin\sed" -i "s/<title.*/<title ng-bind='page_title'>CRM v%VAR%<\/title\/>/" src\main\resources\static\indexMinify.html - + + VAR=$(git rev-parse --short HEAD)_$(date +"%Y%m%d_%H%M") +version=$(echo $GIT_BRANCH | cut -d'/' -f 3) +sed -i "s/<title.*/<title ng-bind='page_title'>CRM v${version}_${VAR}<\/title\/>/" src/main/resources/static/index.html +sed -i "s/<title.*/<title ng-bind='page_title'>CRM v${version}_${VAR}<\/title\/>/" src/main/resources/static/indexMinify.html + - - net stop CRM -FOR /F "tokens=5 delims= " %%P IN ('netstat -a -n -o ^| findstr :50201 ^| findstr LISTEN') DO TaskKill.exe /F /PID %%P -del E:\CHM\CRM\lib\*.* /q -"C:\Program Files\7-Zip\7z.exe" e target\CRM-pack.zip -oE:\CHM\CRM\lib CRM\lib\*.* -r -xcopy /Y /S src\main\resources\templates\* E:\CHM\CRM\templates -net start CRM - + + sudo systemctl stop CRM + + +chm=/opt/CRM/ +tempdir=$(mktemp -d) + +sudo rm -f ${chm}/lib/* +sudo rm -rf ${chm}/templates/* + +7za x target/CRM-pack.zip -o"${tempdir}" +sudo mv -f ${tempdir}/CRM/lib/* "${chm}/lib" +sudo mv -f ${tempdir}/CRM/templates/* "${chm}/templates" +rm -rf "${tempdir}" + +sudo systemctl start CRM + UNSTABLE