forked from liferay/liferay-portal
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build-test-tomcat.xml
252 lines (202 loc) · 8.3 KB
/
build-test-tomcat.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
<?xml version="1.0"?>
<project name="portal-test-tomcat" basedir="." default="test" xmlns:antelope="antlib:ise.antelope.tasks">
<import file="build-test.xml" />
<target name="copy-5.1.7-5.2.7-upgrade-dependencies">
<copy
file="${hudson.portal.dependencies.dir}${lp.version}/lpe2005.7-ee5207-portal-impl-jdk5.jar"
todir="${app.server.tomcat.lib.portal.dir}"
/>
<copy
file="${hudson.portal.dependencies.dir}${lp.version}/lpe2005-ee5207-hook-5.2.7.1.war"
todir="${user.home}/liferay/deploy"
/>
</target>
<target name="copy-optional-jars">
<copy
todir="${app.server.lib.global.dir}">
<fileset
dir="${jdbc.drivers.optional.dir}"
includes="*.jar"
/>
</copy>
</target>
<target name="prepare-cluster-tomcat-node">
<exec executable="${pscp.executable}">
<arg line="-pw ${vm.password} dist/liferay-portal-tomcat-${lp.version}.zip ${vm.username}@${cluster-node.host}:/" />
</exec>
<exec executable="${plink.executable}">
<arg line="-pw ${vm.password} ${vm.username}@${cluster-node.host} cmd.exe /c C:\Progra~1\7-Zip\7z.exe x C:\liferay-portal-tomcat-${lp.version}.zip -oC:\" />
</exec>
<antcall target="replace-remote-file">
<param name="remote.host" value="${cluster-node.host}" />
<param name="remote.file" value="/liferay-portal-${lp.version}/tomcat-${app.server.tomcat.version}/bin/startup.bat" />
<param name="remote.replace.token" value="set "CATALINA_HOME=%cd%"" />
<param name="remote.replace.value" value="set CATALINA_HOME=C:\liferay-portal-${lp.version}\tomcat-${app.server.tomcat.version}" />
</antcall>
<antcall target="replace-remote-file">
<param name="remote.host" value="${cluster-node.host}" />
<param name="remote.file" value="/liferay-portal-${lp.version}/tomcat-${app.server.tomcat.version}/bin/shutdown.bat" />
<param name="remote.replace.token" value="set "CATALINA_HOME=%cd%"" />
<param name="remote.replace.value" value="set CATALINA_HOME=C:\liferay-portal-${lp.version}\tomcat-${app.server.tomcat.version}" />
</antcall>
<antcall target="replace-remote-file">
<param name="remote.host" value="${cluster-node.host}" />
<param name="remote.file" value="/liferay-portal-${lp.version}/tomcat-${app.server.tomcat.version}/conf/server.xml" />
<param name="remote.replace.token" value="<Engine name="Catalina" defaultHost="localhost">" />
<param name="remote.replace.value" value="<Engine name="Catalina" defaultHost="localhost" jvmRoute="${cluster-node.value}">" />
</antcall>
<antcall target="prepare-portal-ext-properties" inheritAll="false" />
<echo file="portal-impl/src/portal-ext.properties" append="true">
net.sf.ehcache.configurationResourceName=/ehcache/hibernate-clustered.xml
ehcache.multi.vm.config.location=/ehcache/liferay-multi-vm-clustered.xml
redirect.url.ips.allowed=127.0.0.1,SERVER_IP,${vm.cluster-node-1.ip}
cluster.link.enabled=true
web.server.display.node=true</echo>
<exec executable="${pscp.executable}">
<arg line="-pw ${vm.password} portal-impl/src/portal-ext.properties ${vm.username}@${cluster-node.host}:/liferay-portal-${lp.version}/tomcat-${app.server.tomcat.version}/webapps/ROOT/WEB-INF/classes" />
</exec>
<delete file="portal-impl/src/portal-ext.properties" />
</target>
<target name="prepare-vm-tomcat">
<antcall target="prepare-zip-tomcat" />
<exec executable="${pscp.executable}">
<arg line="-pw ${vm.password} dist/liferay-portal-tomcat-${lp.version}.zip ${vm.username}@${vm.host}:/" />
</exec>
<exec executable="${plink.executable}">
<arg line="-pw ${vm.password} ${vm.username}@${vm.host} cmd.exe /c C:\Progra~1\7-Zip\7z.exe x C:\liferay-portal-tomcat-${lp.version}.zip -oC:\" />
</exec>
<antcall target="replace-remote-file">
<param name="remote.host" value="${vm.host}" />
<param name="remote.file" value="/liferay-portal-${lp.version}/tomcat-${app.server.tomcat.version}/bin/startup.bat" />
<param name="remote.replace.token" value='set "CATALINA_HOME=%cd%"' />
<param name="remote.replace.value" value="set CATALINA_HOME=C:\liferay-portal-${lp.version}\tomcat-${app.server.tomcat.version}" />
</antcall>
</target>
<target name="prepare-zip-tomcat">
<ant antfile="build-dist.xml" target="build-dist-tomcat" />
<antcall target="revert-test-properties" />
<mkdir dir="dist" />
<ant antfile="build-dist.xml" target="zip-tomcat" />
</target>
<target name="run-selenium-tomcat">
<if>
<not>
<isset property="build.app.server" />
</not>
<then>
<ant antfile="build-dist.xml" target="build-dist-tomcat" />
</then>
</if>
<antcall target="revert-test-properties" />
<if>
<isset property="vm.host" />
<then>
<replace
file="portal-web/test/test-portal-web.properties"
token="#vm.host="
value="vm.host=${vm.host}"
/>
</then>
</if>
<antcall target="prepare-virtual-host-name-properties" />
<antcall target="start-selenium" />
<antcall target="run-tomcat" inheritAll="false">
<param name="test.class" value="${test.name}" />
</antcall>
<antcall target="stop-selenium" />
</target>
<target name="run-selenium-versioned-tomcat">
<if>
<not>
<uptodate
srcfile="${hudson.portal.dependencies.dir}/${lp.version}/${file.name}"
targetfile="${app.server.parent.dir}/${file.name}"
/>
</not>
<then>
<copy
file="${hudson.portal.dependencies.dir}/${lp.version}/${file.name}"
todir="${app.server.parent.dir}"
/>
</then>
</if>
<unzip src="${app.server.parent.dir}/${file.name}" dest="${app.server.parent.dir}" />
<echo file="app.server.${user.name}.properties">app.server.tomcat.dir=${app.server.parent.dir}/${tomcat.folder.dir}</echo>
<antcall target="revert-test-properties" />
<if>
<isset property="jdbc.drivers.optional.dir" />
<then>
<antcall target="copy-optional-jars" inheritAll="false" />
</then>
</if>
<if>
<equals arg1="${legacy.config}" arg2="true" />
<then>
<if>
<equals arg1="${db.type}" arg2="mysql" />
<then>
<antcall target="prepare-root-xml" inheritAll="false">
<param name="db.url" value="jdbc:mysql://${db.mysql.host}/${db.mysql.schema}?useUnicode=true&amp;characterEncoding=UTF-8&amp;useFastDateParsing=false" />
</antcall>
</then>
<else>
<antcall target="prepare-root-xml" inheritAll="false"/>
</else>
</if>
</then>
</if>
<antcall target="deploy-properties" inheritAll="false"/>
<delete dir="${user.home}/liferay" />
<if>
<or>
<equals arg1="${lp.version}" arg2="5.2.5" />
<equals arg1="${lp.version}" arg2="5.2.7" />
<equals arg1="${lp.version}" arg2="5.2.8" />
</or>
<then>
<copy
file="${hudson.license.dependencies.dir}/${lp.version}/license"
todir="${user.home}/liferay/ee"
/>
</then>
<elseif>
<or>
<equals arg1="${lp.version}" arg2="5.2.9" />
<equals arg1="${lp.version}" arg2="6.0.10" />
<equals arg1="${lp.version}" arg2="6.0.11" />
<equals arg1="${lp.version}" arg2="6.0.12" />
</or>
<then>
<copy
todir="${user.home}/liferay/deploy">
<fileset
dir="${hudson.license.dependencies.dir}/${lp.version}"
includes="license-portal-*.xml"
/>
</copy>
</then>
</elseif>
</if>
<antcall target="start-selenium" />
<antcall target="run-tomcat" inheritAll="false">
<param name="test.class" value="${test.name}" />
</antcall>
<antcall target="stop-selenium" />
</target>
<target name="run-tomcat">
<antcall target="clean-up-logs" />
<record action="start" name="log" />
<antcall target="run-simple-server">
<param name="simple.server.dir" value="${app.server.tomcat.dir}" />
<param name="simple.server.bin.dir" value="${app.server.tomcat.bin.dir}" />
<param name="simple.server.deploy.dir" value="${app.server.tomcat.deploy.dir}" />
<param name="simple.server.lib.global.dir" value="${app.server.tomcat.lib.global.dir}" />
<param name="simple.server.portal.dir" value="${app.server.tomcat.portal.dir}" />
<param name="simple.server.start.executable" value="catalina${file.suffix.bat}" />
<param name="simple.server.start.executable.arg.line" value="run" />
<param name="simple.server.stop.executable" value="shutdown${file.suffix.bat}" />
</antcall>
<record action="stop" name="log" />
<antcall target="evaluate-logs" />
</target>
</project>