-
Notifications
You must be signed in to change notification settings - Fork 0
/
jenkins.xml
268 lines (268 loc) · 11.3 KB
/
jenkins.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
<?xml version='1.0' encoding='UTF-8'?>
<project>
<actions/>
<description></description>
<keepDependencies>false</keepDependencies>
<properties>
<com.dabsquared.gitlabjenkins.connection.GitLabConnectionProperty plugin="[email protected]">
<gitLabConnection></gitLabConnection>
</com.dabsquared.gitlabjenkins.connection.GitLabConnectionProperty>
<org.jenkinsci.plugins.gitlablogo.GitlabLogoProperty plugin="[email protected]">
<repositoryName></repositoryName>
</org.jenkinsci.plugins.gitlablogo.GitlabLogoProperty>
<jenkins.model.BuildDiscarderProperty>
<strategy class="hudson.tasks.LogRotator">
<daysToKeep>7</daysToKeep>
<numToKeep>-1</numToKeep>
<artifactDaysToKeep>-1</artifactDaysToKeep>
<artifactNumToKeep>-1</artifactNumToKeep>
</strategy>
</jenkins.model.BuildDiscarderProperty>
</properties>
<scm class="hudson.scm.SubversionSCM" plugin="[email protected]">
<locations>
<hudson.scm.SubversionSCM_-ModuleLocation>
<remote>https://30.1.10.94/svn/SinosoftNewGroup/trunk</remote>
<credentialsId>9386d306-2a4d-420a-b468-bf23725e7827</credentialsId>
<local>.\sourcecode</local>
<depthOption>infinity</depthOption>
<ignoreExternalsOption>true</ignoreExternalsOption>
</hudson.scm.SubversionSCM_-ModuleLocation>
</locations>
<excludedRegions></excludedRegions>
<includedRegions></includedRegions>
<excludedUsers></excludedUsers>
<excludedRevprop></excludedRevprop>
<excludedCommitMessages></excludedCommitMessages>
<workspaceUpdater class="hudson.scm.subversion.UpdateUpdater"/>
<ignoreDirPropChanges>false</ignoreDirPropChanges>
<filterChangelog>false</filterChangelog>
</scm>
<canRoam>true</canRoam>
<disabled>false</disabled>
<blockBuildWhenDownstreamBuilding>false</blockBuildWhenDownstreamBuilding>
<blockBuildWhenUpstreamBuilding>false</blockBuildWhenUpstreamBuilding>
<triggers>
<hudson.triggers.SCMTrigger>
<spec>H 23 * * *
20 12 * * 1-5</spec>
<ignorePostCommitHooks>false</ignorePostCommitHooks>
</hudson.triggers.SCMTrigger>
</triggers>
<concurrentBuild>false</concurrentBuild>
<builders>
<hudson.tasks.BatchFile>
<command>REM 获取java文件更新清单
set date=%date:~0,4%%date:~5,2%%date:~8,2%
del javalist.txt
del uilist.txt
svn diff -r {%date%} --summarize https://30.1.10.94/svn/SinosoftNewGroup/trunk>list.txt</command>
</hudson.tasks.BatchFile>
<hudson.tasks.BatchFile>
<command>REM 处理文件清单
for /f "eol=D tokens=* delims= " %%i in (list.txt) do echo %%i>>temp.txt
del list.txt
ren "temp.txt" "list.txt"
setlocal EnableDelayedExpansion
for /f "tokens=2" %%a in (list.txt) do (
set str=%%a
set str=!str:https://30.1.10.94/svn/SinosoftNewGroup/trunk=!
set str=!str:/ui/=ui/!
set str=!str:/java/=java/!
set str=!str:/=\!
echo !str!>>tmp.txt
)

del list.txt
ren "tmp.txt" "list.txt"
copy list.txt uilist.txt</command>
</hudson.tasks.BatchFile>
<hudson.tasks.BatchFile>
<command>rem 通过java清单编译java类
del D:\jenkins\workspace\新团险dat更新\update\*.* /f/s/q
del D:\jenkins\workspace\新团险dat更新\LIS\*.* /f/s/q

REM 处理java清单中非java类文件
@echo off
set endword=.java
for %%a in (%endword%) do (
findstr /E "%%a$" list.txt >Temp.txt
del list.txt
move Temp.txt javalist.txt
)

REM 如果javalist为空文件,则删除
@echo off
set "paths=javalist.txt"
for %%a in ("%paths%") do (
if "%%~za" equ "0" (
del %paths% 
)
)

REM 编译java文件
if exist javalist.txt goto :aaa
if not exist javalist.txt exit 0

:aaa
set BASEPATH=D:\jenkins\workspace\新团险dat更新\sourcecode
set CLASSPATH=D:\jenkins\workspace\新团险dat更新\update
set LISTPATH=D:\jenkins\workspace\新团险dat更新
set JAVAHOME="C:\Program Files\Java\jdk1.8.0_91\bin"
cd %BASEPATH%
%JAVAHOME%\javac -source 1.7 -target 1.7 -encoding utf-8 -deprecation -extdirs %BASEPATH%\ui\WEB-INF\lib -classpath %BASEPATH%\ui\WEB-INF\classes -d %CLASSPATH%\ui\WEB-INF\classes @%LISTPATH%\javalist.txt


</command>
</hudson.tasks.BatchFile>
<hudson.tasks.BatchFile>
<command>REM 将生成的class文件拷贝到本地代码ui\WEB-INF\classes下面
xcopy D:\jenkins\workspace\新团险dat更新\update\ui\WEB-INF\classes\* D:\jenkins\workspace\新团险dat更新\sourcecode\ui\WEB-INF\classes\ /s/e/y 

REM 处理ui文件清单
cd D:\jenkins\workspace\新团险dat更新
@echo off
set endword=.java
for %%a in (%endword%) do (
findstr /v "%%a$" uilist.txt >tmp.txt
del uilist.txt
move tmp.txt uilist.txt
)

echo 去除清单中的文件夹路径
@echo off
set endword=.
for %%a in (%endword%) do (
findstr /L "%%a" uilist.txt >tmp.txt
del uilist.txt
move tmp.txt uilist.txt
)
rem ui文件拷贝(先生成拷贝脚本)
echo =============通过UI清单生成拷贝命令=================
@echo off&setlocal enabledelayedexpansion
set head=echo f "|" xcopy 
set tail= D:\jenkins\workspace\新团险dat更新\update\
set var= /f/y
for /f "delims=" %%i in (uilist.txt) do (echo !head!%%i!tail!%%i!var!>>D:\jenkins\workspace\新团险dat更新\sourcecode\cpui.txt)

cd D:\jenkins\workspace\新团险dat更新\sourcecode
@echo off&setlocal enabledelayedexpansion
for /f "delims=" %%a in (cpui.txt) do (
set str=%%a
set str=!str:"= !
set str=!str:"= !

echo !str!>>tmp.txt
)
del cpui.txt
ren "tmp.txt" "cpui.bat"

call cpui.bat
del cpui.bat

xcopy D:\jenkins\workspace\新团险dat更新\update\java\* D:\jenkins\workspace\新团险dat更新\update\ui\WEB-INF\classes /s/e/y
rd /s/q D:\jenkins\workspace\新团险dat更新\update\java
xcopy D:\jenkins\workspace\新团险dat更新\update\* D:\jenkins\workspace\新团险dat更新\LIS /s/e/y</command>
</hudson.tasks.BatchFile>
<hudson.tasks.BatchFile>
<command>ECHO ============设置变量==============
SET LOCAL_PATH=D:\jenkins\workspace\新团险dat更新\LIS\ui
SET REMOTE_PATH=/bea/
SET SERVER_HOST=30.1.10.56
SET USER=root
SET PASS=test@123
SET PSCP_PATH=D:\jenkins\workspace


ECHO= PSCP上传服务器(30.1.10.56)

echo y | %PSCP_PATH%\pscp -v -r -pw %PASS% %LOCAL_PATH% %USER%@%SERVER_HOST%:%REMOTE_PATH%</command>
</hudson.tasks.BatchFile>
</builders>
<publishers>
<hudson.plugins.emailext.ExtendedEmailPublisher plugin="[email protected]">
<recipientList></recipientList>
<configuredTriggers>
<hudson.plugins.emailext.plugins.trigger.AlwaysTrigger>
<email>
<recipientList>[email protected] [email protected]</recipientList>
<subject>$PROJECT_DEFAULT_SUBJECT</subject>
<body>$PROJECT_DEFAULT_CONTENT</body>
<recipientProviders>
<hudson.plugins.emailext.plugins.recipients.DevelopersRecipientProvider/>
<hudson.plugins.emailext.plugins.recipients.ListRecipientProvider/>
</recipientProviders>
<attachmentsPattern></attachmentsPattern>
<attachBuildLog>true</attachBuildLog>
<compressBuildLog>false</compressBuildLog>
<replyTo>$PROJECT_DEFAULT_REPLYTO</replyTo>
<contentType>project</contentType>
</email>
</hudson.plugins.emailext.plugins.trigger.AlwaysTrigger>
<hudson.plugins.emailext.plugins.trigger.SuccessTrigger>
<email>
<subject>$PROJECT_DEFAULT_SUBJECT</subject>
<body>$PROJECT_DEFAULT_CONTENT</body>
<recipientProviders>
<hudson.plugins.emailext.plugins.recipients.DevelopersRecipientProvider/>
<hudson.plugins.emailext.plugins.recipients.ListRecipientProvider/>
</recipientProviders>
<attachmentsPattern></attachmentsPattern>
<attachBuildLog>true</attachBuildLog>
<compressBuildLog>false</compressBuildLog>
<replyTo>$PROJECT_DEFAULT_REPLYTO</replyTo>
<contentType>project</contentType>
</email>
</hudson.plugins.emailext.plugins.trigger.SuccessTrigger>
</configuredTriggers>
<contentType>default</contentType>
<defaultSubject>$DEFAULT_SUBJECT</defaultSubject>
<defaultContent>$DEFAULT_CONTENT</defaultContent>
<attachmentsPattern>buildlog.log</attachmentsPattern>
<presendScript>$DEFAULT_PRESEND_SCRIPT</presendScript>
<postsendScript>$DEFAULT_POSTSEND_SCRIPT</postsendScript>
<attachBuildLog>false</attachBuildLog>
<compressBuildLog>false</compressBuildLog>
<replyTo>$DEFAULT_REPLYTO</replyTo>
<saveOutput>false</saveOutput>
<disabled>false</disabled>
</hudson.plugins.emailext.ExtendedEmailPublisher>
<jenkins.plugins.publish__over__ssh.BapSshPublisherPlugin plugin="[email protected]">
<consolePrefix>SSH: </consolePrefix>
<delegate>
<publishers>
<jenkins.plugins.publish__over__ssh.BapSshPublisher>
<configName>30.1.10.56</configName>
<verbose>false</verbose>
<transfers>
<jenkins.plugins.publish__over__ssh.BapSshTransfer>
<remoteDirectory></remoteDirectory>
<sourceFiles></sourceFiles>
<excludes></excludes>
<removePrefix></removePrefix>
<remoteDirectorySDF>false</remoteDirectorySDF>
<flatten>false</flatten>
<cleanRemote>false</cleanRemote>
<noDefaultExcludes>false</noDefaultExcludes>
<makeEmptyDirs>false</makeEmptyDirs>
<patternSeparator>[, ]+</patternSeparator>
<execCommand>bash /root/Oracle/Middleware/user_projects/domains/base_domain/bin/rebootWebLogic56.sh</execCommand>
<execTimeout>120000</execTimeout>
<usePty>false</usePty>
<useAgentForwarding>false</useAgentForwarding>
</jenkins.plugins.publish__over__ssh.BapSshTransfer>
</transfers>
<useWorkspaceInPromotion>false</useWorkspaceInPromotion>
<usePromotionTimestamp>false</usePromotionTimestamp>
</jenkins.plugins.publish__over__ssh.BapSshPublisher>
</publishers>
<continueOnError>false</continueOnError>
<failOnError>false</failOnError>
<alwaysPublishFromMaster>false</alwaysPublishFromMaster>
<hostConfigurationAccess class="jenkins.plugins.publish_over_ssh.BapSshPublisherPlugin" reference="../.."/>
</delegate>
</jenkins.plugins.publish__over__ssh.BapSshPublisherPlugin>
</publishers>
<buildWrappers/>
</project>