forked from aramsoft/aramcomp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
publish.xml
197 lines (164 loc) · 6.27 KB
/
publish.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
<?xml version="1.0"?>
<project name="aramscomp" default="publish">
<property name="tomcat.manager.url" value="http://localhost:6060/manager" />
<property name="hudson.jobs.dir" value="/home/hudson/jobs" />
<property name="tomcat.home" value="/Server/Tomcat-6.0.29" />
<!--
<property name="tomcat.home" value="/home/egov/server/apache-tomcat-6.0.29" />
-->
<property name="proj.name" value="${ant.project.name}"/>
<property name="web.path" value="/"/>
<property environment="env"/>
<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Locations of generated artifacts
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
<property name="deployDir" location="dist"/> <!-- passed in by Anthill -->
<property name="dist.dir" location="${deployDir}"/>
<property name="deploy.dir" location="."/>
<property name="src.dir" location="${hudson.jobs.dir}/${proj.name}/workspace/${proj.name}/src/main/webapp"/>
<property name="work.dir" location="${hudson.jobs.dir}/${proj.name}/workspace/${proj.name}/target/aramcomp-webapp"/>
<property name="publish.home" location="/var/webapps"/>
<property name="publish.dir" location="${publish.home}/${proj.name}"/>
<path id="tomcat.lib.classpath">
<fileset dir="${tomcat.home}/bin">
<include name="*.jar"/>
</fileset>
<fileset dir="${tomcat.home}/lib">
<include name="*.jar"/>
</fileset>
</path>
<!-- ============================================== -->
<!-- -->
<!-- publish webapps -->
<!-- -->
<!-- ============================================== -->
<target name="sync-webapp">
<echo message="sync work webapps/WEB-INF/jsp..."/>
<sync todir="${work.dir}/WEB-INF/jsp/">
<fileset dir="${src.dir}/WEB-INF/jsp">
<include name="**/*"/>
</fileset>
</sync>
<echo message="sync work webapps/WEB-INF/layouts..."/>
<sync todir="${work.dir}/WEB-INF/layouts/">
<fileset dir="${src.dir}/WEB-INF/layouts">
<include name="**/*"/>
</fileset>
</sync>
<echo message="sync work webapps/css..."/>
<sync todir="${work.dir}/css/">
<fileset dir="${src.dir}/css">
<include name="**/*"/>
</fileset>
</sync>
<echo message="sync work webapps/html..."/>
<sync todir="${work.dir}/html/">
<fileset dir="${src.dir}/html">
<include name="**/*"/>
</fileset>
</sync>
<echo message="sync work webapps/images..."/>
<sync todir="${work.dir}/images/">
<fileset dir="${src.dir}/images">
<include name="**/*"/>
</fileset>
</sync>
<echo message="sync work webapps/js..."/>
<sync todir="${work.dir}/js/">
<fileset dir="${src.dir}/js">
<include name="**/*"/>
</fileset>
</sync>
<echo message="sync work webapps/lucene..."/>
<sync todir="${work.dir}/lucene/">
<fileset dir="${src.dir}/lucene">
<include name="**/*"/>
</fileset>
</sync>
<echo message="copy work /*.jsp..."/>
<copy todir="${work.dir}/">
<fileset dir="${src.dir}">
<include name="*.jsp"/>
</fileset>
</copy>
<!--
<echo message="move multimedia to home"/>
<move todir="${publish.home}/multimedia">
<fileset dir="${publish.dir}/multimedia"/>
</move>
-->
<echo message="sync deploy webapps..."/>
<sync todir="${publish.dir}/">
<fileset dir="${work.dir}">
<include name="**/*"/>
</fileset>
</sync>
<!--
<echo message="move multimedia to origin"/>
<move todir="${publish.dir}/multimedia">
<fileset dir="${publish.home}/multimedia"/>
</move>
-->
</target>
<!-- ============================================== -->
<!-- -->
<!-- publish by manager -->
<!-- -->
<!-- ============================================== -->
<target name="publish-manager">
<taskdef name="start" classname="org.apache.catalina.ant.StartTask" >
<classpath refid="tomcat.lib.classpath" />
</taskdef>
<taskdef name="stop" classname="org.apache.catalina.ant.StopTask" >
<classpath refid="tomcat.lib.classpath" />
</taskdef>
<taskdef name="list" classname="org.apache.catalina.ant.ListTask" >
<classpath refid="tomcat.lib.classpath" />
</taskdef>
<stop url="${tomcat.manager.url}"
username="${tomcat.manager.username}"
password="${tomcat.manager.password}"
path="${web.path}" />
<antcall target="sync-webapp" />
<start url="${tomcat.manager.url}"
username="${tomcat.manager.username}"
password="${tomcat.manager.password}"
path="${web.path}" />
</target>
<!-- ============================================== -->
<!-- -->
<!-- tomcat restart by shell program -->
<!-- -->
<!-- ============================================== -->
<target name="stop-tomcat">
<echo message="shutdown tomcat server..." />
<exec executable="${tomcat.home}/bin/shutdown.sh"
failonerror ="true" >
<arg value="-force" />
</exec>
<echo message="stopped tomcat server..." />
</target>
<target name="start-tomcat">
<echo message="startup tomcat server..." />
<exec executable="${tomcat.home}/bin/startup.sh"
failonerror ="true" />
<echo message="started tomcat server..." />
</target>
<target name="publish-restart">
<antcall target="stop-tomcat" />
<echo message="sleep for 10 second... " />
<sleep seconds="10" />
<antcall target="sync-webapp" />
<antcall target="start-tomcat" />
</target>
<!-- ============================================== -->
<!-- -->
<!-- Deploy Webapp -->
<!-- -->
<!-- ============================================== -->
<target name="publish">
<antcall target="sync-webapp" />
<!--antcall target="publish-manager" /-->
<!--antcall target="publish-restart" /-->
</target>
</project>