From 67e29957117e3cba1b7ab24431533f7017e0d063 Mon Sep 17 00:00:00 2001 From: "YM-RD-AP01\\ymadmin" Date: Thu, 22 Nov 2018 18:16:01 +0800 Subject: [PATCH] 20140144: Job [Deploy_CRM_API_Prod] configuration updated MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change performed by ·¨¼y°ó --- jobs/Deploy_CRM_API_Prod/config.xml | 49 ++++++++++++++++------------- 1 file changed, 27 insertions(+), 22 deletions(-) diff --git a/jobs/Deploy_CRM_API_Prod/config.xml b/jobs/Deploy_CRM_API_Prod/config.xml index 9837e450..2181983d 100644 --- a/jobs/Deploy_CRM_API_Prod/config.xml +++ b/jobs/Deploy_CRM_API_Prod/config.xml @@ -15,15 +15,15 @@ master release/1.15GA hotfix/1.15.1GA - release/1.40GA + master false - 1 - 2 + -1 + 5 -1 -1 @@ -51,11 +51,7 @@ hotfix/1.15.1GA false false false - - - 0 7,13,17 * * * - - + false org.ylhealth.ym.chmapi @@ -65,7 +61,7 @@ hotfix/1.15.1GA spring-boot:run true false - false + true false true false @@ -80,7 +76,7 @@ hotfix/1.15.1GA - $RD_Group + $RD_Group $QA_Group false false true @@ -123,20 +119,29 @@ hotfix/1.15.1GA - - 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 - - + + set path=%path%;"C:\Program Files\Git\usr\bin"; + +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% +for /F "delims=/ tokens=3" %%i in ("%GIT_BRANCH%") do set version=%%i + +echo Version:%VAR% + - - systemctl stop CRM_API -rm -f /opt/chm/chmapi/lib/*.jar -/usr/bin/unzip -j -o target/chmapi-pack.zip "chmapi/lib/*" -d /opt/chm/chmapi/lib -systemctl start CRM_API - + + ssh -i F:/jenkins/id_rsa ymadmin@10.36.220.122 "rm -f /opt/chm/chmapi-pack.zip" +scp -i F:/jenkins/id_rsa target/chmapi-pack.zip ymadmin@10.36.220.122:/opt/chm/ + SUCCESS -- 2.26.2