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

20140144: Job [Deploy_CHM_DEV_115] configuration updated

Change performed by ·¨¼y°ó
parent 9dd51da7
......@@ -4,12 +4,12 @@
<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>2</daysToKeep>
<daysToKeep>-1</daysToKeep>
<numToKeep>5</numToKeep>
<artifactDaysToKeep>-1</artifactDaysToKeep>
<artifactNumToKeep>-1</artifactNumToKeep>
......@@ -83,32 +83,35 @@
</hudson.maven.reporters.MavenMailer>
</reporters>
<publishers/>
<buildWrappers/>
<buildWrappers>
<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;
&quot;C:\Program Files\Git\usr\bin\sed&quot; -i &quot;s/&lt;title.*/&lt;title ng-bind=&apos;page_title&apos;&gt;CRM v%VAR%&lt;\/title\/&gt;/&quot; src\main\resources\static\index.html&#xd;
&quot;C:\Program Files\Git\usr\bin\sed&quot; -i &quot;s/&lt;title.*/&lt;title ng-bind=&apos;page_title&apos;&gt;CRM v%VAR%&lt;\/title\/&gt;/&quot; src\main\resources\static\indexMinify.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 ng-bind=&apos;page_title&apos;&gt;CRM v${version}_${VAR}&lt;\/title\/&gt;/&quot; src/main/resources/static/index.html
sed -i &quot;s/&lt;title.*/&lt;title ng-bind=&apos;page_title&apos;&gt;CRM v${version}_${VAR}&lt;\/title\/&gt;/&quot; src/main/resources/static/indexMinify.html</command>
</hudson.tasks.Shell>
</prebuilders>
<postbuilders>
<hudson.tasks.BatchFile>
<command>net stop CRM&#xd;
FOR /F &quot;tokens=5 delims= &quot; %%P IN (&apos;netstat -a -n -o ^| findstr :50201 ^| findstr LISTEN&apos;) DO TaskKill.exe /F /PID %%P&#xd;
del E:\CHM\CRM\lib\*.* /q&#xd;
&quot;C:\Program Files\7-Zip\7z.exe&quot; e target\CRM-pack.zip -oE:\CHM\CRM\lib CRM\lib\*.* -r&#xd;
xcopy /Y /S src\main\resources\templates\* E:\CHM\CRM\templates&#xd;
net start CRM</command>
</hudson.tasks.BatchFile>
<hudson.tasks.Shell>
<command>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&quot;${tempdir}&quot;
sudo mv -f ${tempdir}/CRM/lib/* &quot;${chm}/lib&quot;
sudo mv -f ${tempdir}/CRM/templates/* &quot;${chm}/templates&quot;
rm -rf &quot;${tempdir}&quot;
sudo systemctl start CRM</command>
</hudson.tasks.Shell>
</postbuilders>
<runPostStepsIfResult>
<name>UNSTABLE</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