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 @@ ...@@ -4,13 +4,13 @@
<description></description> <description></description>
<keepDependencies>false</keepDependencies> <keepDependencies>false</keepDependencies>
<properties> <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> <gitLabConnection>ylhealth</gitLabConnection>
</com.dabsquared.gitlabjenkins.connection.GitLabConnectionProperty> </com.dabsquared.gitlabjenkins.connection.GitLabConnectionProperty>
<jenkins.model.BuildDiscarderProperty> <jenkins.model.BuildDiscarderProperty>
<strategy class="hudson.tasks.LogRotator"> <strategy class="hudson.tasks.LogRotator">
<daysToKeep>1</daysToKeep> <daysToKeep>-1</daysToKeep>
<numToKeep>1</numToKeep> <numToKeep>5</numToKeep>
<artifactDaysToKeep>-1</artifactDaysToKeep> <artifactDaysToKeep>-1</artifactDaysToKeep>
<artifactNumToKeep>-1</artifactNumToKeep> <artifactNumToKeep>-1</artifactNumToKeep>
</strategy> </strategy>
...@@ -90,32 +90,29 @@ ...@@ -90,32 +90,29 @@
<hudson.plugins.timestamper.TimestamperBuildWrapper plugin="timestamper@1.8.10"/> <hudson.plugins.timestamper.TimestamperBuildWrapper plugin="timestamper@1.8.10"/>
</buildWrappers> </buildWrappers>
<prebuilders> <prebuilders>
<hudson.tasks.BatchFile> <hudson.tasks.Shell>
<command>REM 取得今天的年、月、日 (自動補零)&#xd; <command>VAR=$(git rev-parse --short HEAD)_$(date +&quot;%Y%m%d_%H%M&quot;)
SETLOCAL EnableDelayedExpansion&#xd; version=$(echo $GIT_BRANCH | cut -d&apos;/&apos; -f 3)
&#xd; 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>
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; </hudson.tasks.Shell>
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>
</prebuilders> </prebuilders>
<postbuilders> <postbuilders>
<hudson.tasks.BatchFile> <hudson.tasks.Shell>
<command>set target=E:\CHM\CHMB&#xd; <command>sudo systemctl stop CHMB
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; chmb=/opt/CHMB
del %target%\lib\*.* /q&#xd; tempdir=$(mktemp -d)
&quot;C:\Program Files\7-Zip\7z.exe&quot; e target\CHMB-pack.zip -o%target%\lib CHMB\lib\*.* -r&#xd; 7za x target/CHMB-pack.zip -o&quot;${tempdir}&quot;
xcopy /Y /S src\main\resources\template\* %target%\template&#xd; rm -rf ${chmb}/lib/*
xcopy /Y /S src\main\resources\sample\* %target%\sample&#xd; rm -rf ${chmb}/sample/*
net start CRM_HRB</command> rm -rf ${chmb}/template/*
</hudson.tasks.BatchFile> 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> </postbuilders>
<runPostStepsIfResult> <runPostStepsIfResult>
<name>SUCCESS</name> <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