forked from liferay/liferay-portal
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build-test-plugins.xml
285 lines (222 loc) · 9.7 KB
/
build-test-plugins.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
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
<?xml version="1.0"?>
<project name="portal-test-plugins" basedir="." default="test" xmlns:antelope="antlib:ise.antelope.tasks">
<import file="build-test.xml" />
<target name="deploy-simple-server-plugins">
<if>
<not>
<equals arg1="${plugins.deployed}" arg2="true" />
</not>
<then>
<delete dir="${liferay.home}/data" />
<delete dir="${liferay.home}/deploy" />
<delete dir="${liferay.home}/logs" />
</then>
</if>
<if>
<equals arg1="${app.server.type}" arg2="websphere" />
<then>
<echo file="${lp.plugins.dir}/build.${user.name}.properties">app.server.type=websphere
app.server.dir=${simple.server.dir}
app.server.deploy.dir=${app.server.dir}/profiles/liferay/wsadmin-deploy
app.server.lib.global.dir=${app.server.dir}/lib/ext
app.server.portal.dir=${app.server.dir}/profiles/liferay/installedApps/liferay-cell/liferay-portal.ear/liferay-portal.war
auto.deploy.dir=${liferay.home}/deploy
plugins.includes=${plugins.includes}</echo>
</then>
<else>
<echo file="${lp.plugins.dir}/build.${user.name}.properties">app.server.dir=${simple.server.dir}
app.server.lib.global.dir=${simple.server.lib.global.dir}
app.server.portal.dir=${simple.server.portal.dir}
auto.deploy.dir=${liferay.home}/deploy
plugins.includes=${plugins.includes}</echo>
</else>
</if>
<if>
<isset property="plugin.portlets.properties" />
<then>
<echo file="${lp.plugins.dir}/${plugin.types}/${portlet.plugins.includes}/docroot/WEB-INF/src/portlet-ext.properties">${plugin.portlets.properties}</echo>
</then>
</if>
<ant dir="${lp.plugins.dir}/${plugin.types}" inheritAll="false">
<target name="clean" />
<target name="deploy" />
</ant>
<delete dir="${lp.plugins.dir}/dist" />
<mkdir dir="${lp.plugins.dir}/dist" />
</target>
<target name="deploy-versioned-simple-server-plugins">
<if>
<or>
<equals arg1="${lp.version}" arg2="5.2.3" />
<equals arg1="${lp.version}" arg2="5.2.4" />
</or>
<then>
<property name="file.dir" value="5.2.2" />
</then>
<elseif>
<equals arg1="${lp.version}" arg2="6.1.1" />
<then>
<property name="file.dir" value="6.1.1-ga2" />
</then>
</elseif>
<else>
<property name="file.dir" value="${lp.version}" />
</else>
</if>
<copy todir="${liferay.home}/deploy">
<fileset
dir="${hudson.plugin.dependencies.dir}/${file.dir}"
includes="${plugins.includes}"
/>
</copy>
</target>
<target name="deploy-websphere-6.1-plugins">
<echo file="${lp.plugins.dir}/build.${user.name}.properties">app.server.dir=${app.server.tomcat.dir}
app.server.lib.global.dir=${app.server.tomcat.lib.global.dir}
app.server.portal.dir=${app.server.tomcat.portal.dir}
plugins.includes=${plugins.includes}</echo>
<ant dir="${lp.plugins.dir}/${plugin.types}" inheritAll="false">
<target name="clean" />
<target name="war" />
</ant>
<exec executable="${plink.executable}">
<arg line="-pw ${vm.password} ${vm.username}@${vm.host} cmd.exe /c mkdir C:\WINDOWS\system32\config\systemprofile\liferay\websphere-deploy" />
</exec>
<exec executable="${pscp.executable}">
<arg line="-pw ${vm.password} ${lp.plugins.dir}\dist\*.war ${vm.username}@${vm.host}:/WINDOWS/system32/config/systemprofile/liferay/deploy" />
</exec>
<sleep seconds="30" />
<delete dir="${lp.plugins.dir}/dist" />
<mkdir dir="${lp.plugins.dir}/dist" />
<echo file="wsadmin-plugins.jacl">$AdminApp list</echo>
<for list="${plugins.includes}" param="plugin.name">
<sequential>
<echo file="wsadmin-plugins.jacl" append="true">
$AdminApp update liferay-portal modulefile {-operation addupdate -contents C:/WINDOWS/system32/config/systemprofile/liferay/websphere-deploy/@{plugin.name}.war -contextroot /@{plugin.name} -contenturi @{plugin.name} -usedefaultbindings}
$AdminConfig save</echo>
</sequential>
</for>
<exec executable="${pscp.executable}">
<arg line="-pw ${vm.password} wsadmin-plugins.jacl ${vm.username}@${vm.host}:/" />
</exec>
<delete file="wsadmin-plugins.jacl" />
<exec executable="${plink.executable}">
<arg line="-pw ${vm.password} ${vm.username}@${vm.host} cmd.exe /c C:\Progra~1\IBM\WebSphere\AppServer\bin\wsadmin.bat -f C:\wsadmin-plugins.jacl" />
</exec>
</target>
<target name="deploy-websphere-8.0-plugins">
<echo file="${lp.plugins.dir}/build.${user.name}.properties">app.server.dir=${app.server.tomcat.dir}
app.server.lib.global.dir=${app.server.tomcat.lib.global.dir}
app.server.portal.dir=${app.server.tomcat.portal.dir}
plugins.includes=${plugins.includes}</echo>
<ant dir="${lp.plugins.dir}/${plugin.types}" inheritAll="false">
<target name="clean" />
<target name="war" />
</ant>
<exec executable="${plink.executable}">
<arg line="-pw ${vm.password} ${vm.username}@${vm.host} cmd.exe /c mkdir C:\WINDOWS\system32\config\systemprofile\liferay\websphere-deploy" />
</exec>
<exec executable="${pscp.executable}">
<arg line="-pw ${vm.password} ${lp.plugins.dir}\dist\*.war ${vm.username}@${vm.host}:/WINDOWS/system32/config/systemprofile/liferay/deploy" />
</exec>
<sleep seconds="30" />
<delete dir="${lp.plugins.dir}/dist" />
<mkdir dir="${lp.plugins.dir}/dist" />
<echo file="wsadmin-plugins.py">print AdminApp.list()</echo>
<for list="${plugins.includes}" param="plugin.name">
<sequential>
<echo file="wsadmin-plugins.py" append="true">
print AdminApp.update('liferay-portal','modulefile','[-operation addupdate -contents C:/WINDOWS/system32/config/systemprofile/liferay/websphere-deploy/@{plugin.name}.war -contextroot /@{plugin.name} -contenturi @{plugin.name} -usedefaultbindings]')
print AdminConfig.save()</echo>
</sequential>
</for>
<exec executable="${pscp.executable}">
<arg line="-pw ${vm.password} wsadmin-plugins.py ${vm.username}@${vm.host}:/" />
</exec>
<delete file="wsadmin-plugins.py" />
<exec executable="${plink.executable}">
<arg line="-pw ${vm.password} ${vm.username}@${vm.host} cmd.exe /c C:\Progra~1\IBM\WebSphere\AppServer\bin\wsadmin.bat -f C:\wsadmin-plugins.py" />
</exec>
</target>
<target name="test-build-plugins-release">
<taskdef classname="com.oopsconsultancy.xmltask.ant.XmlTask" classpath="lib/development/xmltask.jar" name="xmltask" />
<ant dir="${lp.plugins.dir}" target="build-summary" inheritAll="false" />
<echo file="${lp.plugins.dir}/build.${user.name}.properties">plugins.includes=</echo>
<xmltask source="${lp.plugins.dir}/summary.xml">
<call path="plugins-summary/plugin">
<param name="plugins.includes.plugin.marketplace" path="releng/marketplace/text()" />
<param name="plugins.includes.plugin.name" path="artifact-id/text()" />
<actions>
<if>
<equals arg1="@{plugins.includes.plugin.marketplace}" arg2="true" />
<then>
<echo append="true" file="${lp.plugins.dir}/build.${user.name}.properties">@{plugins.includes.plugin.name},</echo>
</then>
</if>
</actions>
</call>
</xmltask>
<ant antfile="${lp.plugins.dir}/build.xml" target="all" inheritAll="false" />
<delete file="${lp.plugins.dir}/build.${user.name}.properties" />
</target>
<target name="test-create">
<echo file="${lp.plugins.dir}/build.${user.name}.properties">app.server.dir=${app.server.tomcat.dir}</echo>
<for list="ext,hooks,layouttpl,portlets,themes" param="plugin.type">
<sequential>
<var name="plugin.type" value="@{plugin.type}" />
<script classpathref="project.classpath" language="beanshell">
String pluginTypeSingular = project.getProperty("plugin.type");
if (pluginTypeSingular.endsWith("s")) {
pluginTypeSingular = pluginTypeSingular.substring(0, pluginTypeSingular.length() - 1);
}
project.setProperty("plugin.type.singular", pluginTypeSingular);
</script>
<delete dir="${lp.plugins.dir}/${plugin.type}/test-${plugin.type.singular}" />
<exec dir="${lp.plugins.dir}/${plugin.type}" executable="create${file.suffix.bat}" outputproperty="create.output" resolveexecutable="true">
<arg line="test test" />
</exec>
<echo>${create.output}</echo>
<if>
<or>
<contains string="${create.output}" substring="BUILD FAILED" />
<not>
<available file="${lp.plugins.dir}/${plugin.type}/test-${plugin.type.singular}" />
</not>
</or>
<then>
<fail>Unable to create ${plugin.type}.</fail>
</then>
</if>
<var name="create.output" unset="true" />
<delete dir="${lp.plugins.dir}/${plugin.type}/test-${plugin.type.singular}" />
</sequential>
</for>
</target>
<target name="test-service-builder">
<echo file="${lp.plugins.dir}/build.${user.name}.properties">app.server.dir=${app.server.tomcat.dir}</echo>
<delete dir="${lp.plugins.dir}/portlets/sample-service-builder-portlet/docroot/WEB-INF/service" />
<delete dir="${lp.plugins.dir}/portlets/sample-service-builder-portlet/docroot/WEB-INF/src/META-INF" />
<ant antfile="${lp.plugins.dir}/portlets/sample-service-builder-portlet/build.xml" target="build-service" inheritAll="false" />
<delete dir="${lp.plugins.dir}/portlets/sample-service-builder-portlet/docroot/WEB-INF/service" />
<delete dir="${lp.plugins.dir}/portlets/sample-service-builder-portlet/docroot/WEB-INF/src/META-INF" />
<if>
<equals arg1="${scm.tool}" arg2="git" />
<then>
<exec dir="${lp.plugins.dir}" executable="git">
<arg line="checkout portlets/sample-service-builder-portlet" />
</exec>
</then>
<elseif>
<equals arg1="${scm.tool}" arg2="svn" />
<then>
<exec executable="svn">
<arg line="--username ${svn.username} --password ${svn.password} update ${lp.plugins.dir}/portlets/sample-service-builder-portlet/docroot/WEB-INF" />
</exec>
<exec executable="svn">
<arg line="revert --recursive ${lp.plugins.dir}/portlets/sample-service-builder-portlet" />
</exec>
</then>
</elseif>
</if>
</target>
</project>