Commit cc34c4a9 authored by YM-RD-AP01\ymadmin's avatar YM-RD-AP01\ymadmin

20140144: Job [Deploy_CHMB_DEV_115] configuration updated

Change performed by ·¨¼y°ó
parent 0afd610d
......@@ -4,13 +4,13 @@
<description></description>
<keepDependencies>false</keepDependencies>
<properties>
<com.dabsquared.gitlabjenkins.connection.GitLabConnectionProperty plugin="gitlab-plugin@1.5.9">
<com.dabsquared.gitlabjenkins.connection.GitLabConnectionProperty plugin="gitlab-plugin@1.5.10">
<gitLabConnection>ylhealth</gitLabConnection>
</com.dabsquared.gitlabjenkins.connection.GitLabConnectionProperty>
<jenkins.model.BuildDiscarderProperty>
<strategy class="hudson.tasks.LogRotator">
<daysToKeep>1</daysToKeep>
<numToKeep>1</numToKeep>
<daysToKeep>-1</daysToKeep>
<numToKeep>5</numToKeep>
<artifactDaysToKeep>-1</artifactDaysToKeep>
<artifactNumToKeep>-1</artifactNumToKeep>
</strategy>
......@@ -90,32 +90,29 @@
<hudson.plugins.timestamper.TimestamperBuildWrapper plugin="timestamper@1.8.10"/>
</buildWrappers>
<prebuilders>
<hudson.tasks.BatchFile>
<command>REM 取得今天的年、月、日 (自動補零)&#xd;
SETLOCAL EnableDelayedExpansion&#xd;
&#xd;
for /f &quot;skip=1 tokens=1-6 delims= &quot; %%a in (&apos;wmic path Win32_LocalTime Get Day^,Hour^,Minute^,Month^,Second^,Year /Format:table&apos;) do (&#xd;
IF NOT &quot;%%~f&quot;==&quot;&quot; (&#xd;
set /a FormattedDate=10000 * %%f + 100 * %%d + %%a&#xd;
set FormattedDate=%%f!FormattedDate:~-4,2!!FormattedDate:~-2,2!_%%b:%%c&#xd;
)&#xd;
)&#xd;
for /f &quot;tokens=*&quot; %%i in (&apos;git rev-parse --short HEAD&apos;) do set VAR=%%i_%FormattedDate%&#xd;
&#xd;
&quot;C:\Program Files\Git\usr\bin\sed&quot; -i &quot;s/&lt;title.*/&lt;title&gt;CHM Booking Manage v%VAR%&lt;\/title\/&gt;/&quot; src\main\resources\static\index.html</command>
</hudson.tasks.BatchFile>
<hudson.tasks.Shell>
<command>VAR=$(git rev-parse --short HEAD)_$(date +&quot;%Y%m%d_%H%M&quot;)
version=$(echo $GIT_BRANCH | cut -d&apos;/&apos; -f 3)
sed -i &quot;s/&lt;title.*/&lt;title&gt;CHM Booking Manage v${version}_${VAR}&lt;\/title\/&gt;/&quot; src/main/resources/static/index.html</command>
</hudson.tasks.Shell>
</prebuilders>
<postbuilders>
<hudson.tasks.BatchFile>
<command>set target=E:\CHM\CHMB&#xd;
net stop CRM_HRB&#xd;
FOR /F &quot;tokens=5 delims= &quot; %%P IN (&apos;netstat -a -n -o ^| findstr :50401 ^| findstr LISTEN&apos;) DO TaskKill.exe /F /PID %%P&#xd;
del %target%\lib\*.* /q&#xd;
&quot;C:\Program Files\7-Zip\7z.exe&quot; e target\CHMB-pack.zip -o%target%\lib CHMB\lib\*.* -r&#xd;
xcopy /Y /S src\main\resources\template\* %target%\template&#xd;
xcopy /Y /S src\main\resources\sample\* %target%\sample&#xd;
net start CRM_HRB</command>
</hudson.tasks.BatchFile>
<hudson.tasks.Shell>
<command>sudo systemctl stop CHMB
chmb=/opt/CHMB
tempdir=$(mktemp -d)
7za x target/CHMB-pack.zip -o&quot;${tempdir}&quot;
rm -rf ${chmb}/lib/*
rm -rf ${chmb}/sample/*
rm -rf ${chmb}/template/*
mv -f ${tempdir}/CHMB/lib/* &quot;${chmb}/lib&quot;
mv -f ${tempdir}/CHMB/sample/* &quot;${chmb}/sample&quot;
mv -f ${tempdir}/CHMB/template/* &quot;${chmb}/template&quot;
rm -rf &quot;${tempdir}&quot;
sudo systemctl start CHMB</command>
</hudson.tasks.Shell>
</postbuilders>
<runPostStepsIfResult>
<name>SUCCESS</name>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment