forked from ces-huynguyen/liferay-portal
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild-test-httpd.xml
107 lines (90 loc) · 2.63 KB
/
build-test-httpd.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
<?xml version="1.0"?>
<project basedir="." name="portal-test-httpd" xmlns:antelope="antlib:ise.antelope.tasks">
<import file="build-test.xml" />
<target name="configure-httpd-server">
<get-test-url />
<propertyregex
input="${test.url}"
property="hostname"
regexp="(http:\/\/)(.*)(:[0-9][0-9])"
select="\2"
/>
<if>
<not>
<resourcecontains
resource="${apache.http.dir}/conf/httpd.conf"
substring="VirtualHost *:80"
/>
</not>
<then>
<echo append="true" file="${apache.http.dir}/conf/httpd.conf"><![CDATA[
<VirtualHost *:80>
ServerName ${hostname}
ProxyPreserveHost On
ProxyPass /liferay http://${hostname}:8080
ProxyPassReverse /liferay http://${hostname}:8080
</VirtualHost>]]></echo>
</then>
</if>
<get-testcase-property property.name="app.server.bundles.size" />
<if>
<isset property="app.server.bundles.size" />
<then>
<var name="app.server.bundle.index" value="1" />
<antelope:repeat count="${app.server.bundles.size}">
<set-app-server-properties
app.server.bundle.index="${app.server.bundle.index}"
/>
<if>
<not>
<resourcecontains
resource="${apache.http.dir}/conf/httpd.conf"
substring="Listen ${test.app.server.leading.port.number}0"
/>
</not>
<then>
<echo append="true" file="${apache.http.dir}/conf/httpd.conf"><![CDATA[
Listen ${test.app.server.leading.port.number}0]]></echo>
</then>
</if>
<if>
<not>
<resourcecontains
resource="${apache.http.dir}/conf/httpd.conf"
substring="VirtualHost *:${test.app.server.leading.port.number}0"
/>
</not>
<then>
<echo append="true" file="${apache.http.dir}/conf/httpd.conf"><![CDATA[
<VirtualHost *:${test.app.server.leading.port.number}0>
ServerName ${hostname}
ProxyPreserveHost On
ProxyPass /liferay http://${hostname}:${test.app.server.leading.port.number}080
ProxyPassReverse /liferay http://${hostname}:${test.app.server.leading.port.number}080
</VirtualHost>]]></echo>
</then>
</if>
<math
datatype="int"
operand1="${app.server.bundle.index}"
operand2="1"
operation="+"
result="app.server.bundle.index"
/>
</antelope:repeat>
<var name="app.server.bundle.index" unset="true" />
</then>
</if>
<print-file file.name="${apache.http.dir}/conf/httpd.conf" />
</target>
<target name="start-httpd-server">
<exec executable="systemctl">
<arg line="start httpd.service" />
</exec>
</target>
<target name="stop-httpd-server">
<exec executable="systemctl">
<arg line="stop httpd.service" />
</exec>
</target>
</project>