root/trunk/deployment/build.xml

Revision 1938 (checked in by douglm, 5 years ago)

Try to do the same for platforms (jboss, tomcat etc) as I just did for portals.

The deployment directories are much simplified and the build process seems a bit clearer.

Line 
1 <?xml version="1.0"?>
2
3 <!-- ===================== Deployment build file =======================
4      This directory and the files within it are to be part of the config
5      and deployment process.
6
7      A number of properties of the form org.bedework.install.XXX will be
8      defined, each indicating that a particualr component is to be deployed.
9
10      Targets below will be executed only if that property is defined.
11
12      Adding a new configuration, e.g. a different portal platform, requires
13      the steps:
14         Create a subdirectory in each components subdirectory,
15         e.g.  webadmin/myportal
16
17         Create any other required resource directories and resources and
18         create a build.xml file to configure and package the component(s).
19
20         Update the config program to load, save and display the new
21         properties for that configuration.
22
23         Add an antcall for each component and a corresponding target
24
25      Authors: Mike Douglass   douglm@rpi.edu
26      =================================================================== -->
27
28 <project name="deploy.bedework" default="init">
29   <property name="base.name" value="deployment"/>
30
31   <property name="org.bedework.temp.wars.home"
32             location="${org.bedework.temp.dir}/wars" />
33
34   <property name="org.bedework.temp.shellscr.home"
35             location="${org.bedework.temp.dir}/shellscr" />
36
37   <!-- Recreateed by each app build file. Place extra jars here -->
38   <property name="org.bedework.temp.extrajars.dir"
39             location="${org.bedework.temp.dir}/extrajars" />
40
41   <dirname property="this.build.dir" file="${ant.file}"/>
42   <property name="bedework.deployment.base" location="this.build.dir" />
43
44   <import file="${build.dir}/getJar.xml"/>
45
46   <import file="${this.build.dir}/appjars.xml" />
47
48   <import file="${build.dir}/loadDeployConfig.xml"/>
49
50   <target name="init" >
51     <getAppJars />
52
53     <property name="source.home" location="${this.build.dir}/src"/>
54
55     <loadDeployConfig />
56
57     <!-- default to debug off -->
58     <property name="app.debug.val" value="0" />
59
60     <!-- set this for the war builds -->
61     <dirname property="app.root.dir" file="${ant.file}"/>
62
63     <!-- Common resources directory -->
64     <property name="org.bedework.common.resources"
65               location="${app.root.dir}/resources" />
66
67     <if>
68       <not>
69         <isset property="org.bedework.global.context.roots" />
70       </not>
71       <then>
72         <tempfile property="org.bedework.global.context.roots"
73                   destdir="${org.bedework.temp.dir}"
74                   prefix="context-roots" suffix=".properties" />
75       </then>
76     </if>
77   </target>
78
79   <target name="deftasks" depends="init">
80     <path id="app.xml.cp">
81       <pathelement location="${org.bedework.deployutil.jar}"/>
82     </path>
83
84     <taskdef name="forEachApp"
85              classname="org.bedework.deployment.ForEachAppTask">
86       <classpath refid="app.xml.cp"/>
87     </taskdef>
88
89     <taskdef name="resolveFile"
90              classname="org.bedework.deployment.ResolveFile">
91       <classpath refid="app.xml.cp"/>
92     </taskdef>
93
94     <taskdef name="makeLangXsl"
95              classname="org.bedework.deployment.MakeLangXsl">
96       <classpath refid="app.xml.cp"/>
97     </taskdef>
98   </target>
99
100   <target name="build.configured" depends="deftasks" >
101     <!-- Clean up before we start -->
102     <delete dir="${org.bedework.temp.wars.home}" />
103
104     <antcall target="build.apps" inheritrefs="true" />
105   </target>
106
107   <!-- =================================================================
108        Targets called by the build.configured target. Each is conditional on a
109        config property and each executes a build file in a subdirectory of
110        this component.
111        ================================================================= -->
112
113   <target name="build.apps" >
114     <property name="org.bedework.deploy.kind" value="webapp" />
115     <antcall target="build.configured.apps" inheritrefs="true" />
116   </target>
117
118   <!-- =================================================================
119                          The deploy target.
120        ================================================================= -->
121
122   <target name="deploy" depends="deftasks" >
123     <!-- Clean up before we start -->
124     <delete dir="${org.bedework.temp.wars.home}" />
125
126     <property name="org.bedework.lang.properties"
127               location="${org.bedework.project.calendarapi}/calFacade/resources/org/bedework/locale/resources" />
128
129     <property name="org.bedework.xsllang.dir"
130               location="${org.bedework.temp.dir}/xsllang" />
131
132     <delete dir="${org.bedework.xsllang.dir}"/>
133     <mkdir dir="${org.bedework.xsllang.dir}"/>
134
135     <makeLangXsl dir="${org.bedework.lang.properties}"
136                  prefix="BwResources"
137                  resdir="${org.bedework.xsllang.dir}"
138                  xsldir="${org.bedework.xsllang.dir}"
139                  name="org.bedework.locales"
140                  check="true" />
141
142     <!-- Build the webapps stuff.-->
143     <antcall target="deploy.apps" inheritrefs="true" >
144       <param name="org.bedework.deploy.kind" value="webapp" />
145     </antcall>
146
147     <!-- Build the shellscr stuff.-->
148     <antcall target="deploy.apps" inheritrefs="true" >
149       <param name="org.bedework.deploy.kind" value="shellscr" />
150     </antcall>
151
152     <!-- copy startup website that sends you to the applications -->
153     <delete dir="${webapp.root.dir}/bedework"/>
154     <mkdir dir="${webapp.root.dir}/bedework"/>
155     <copy todir="${webapp.root.dir}/bedework">
156       <fileset dir="${app.root.dir}/resources/bedework"/>
157     </copy>
158
159     <!-- copy libs that the application server needs -->
160     <antcall target="deploy.appserver.jdbcdriver" inheritrefs="true" />
161     <antcall target="deploy.appserver.javatools" inheritrefs="true" />
162   </target>
163
164   <!-- =================================================================
165        Targets called by the deploy target. Each is conditional on a
166        config property and each executes a build file in a subdirectory of
167        this component.
168        ================================================================= -->
169
170   <!-- The cp.xalan task conditionally copies the xalan.jar file, if
171        necessary -->
172   <target name="cp.xalan" if="xalan.in.tomcat.common.endorsed">
173     <copy file="${org.bedework.default.lib}/xalan.jar"
174           todir="${appserver.endorsed.dir}"/>
175   </target>
176
177   <target name="deploy.appserver.jdbcdriver"
178           if="appserver.jdbcdriver.jar" >
179     <!-- copy jdbc jar so datasources work -->
180     <copy todir="${appserver.lib.dir}" file="${appserver.jdbcdriver.jar}"/>
181   </target>
182
183   <target name="deploy.appserver.javatools"
184           if="java.tools.jar" >
185     <!-- copy tools jar so jsps work -->
186     <copy todir="${appserver.lib.dir}" file="${java.tools.jar}"/>
187   </target>
188
189   <!-- =================================================================
190        Targets called by the build.configured target. Each is conditional on a
191        config property and each executes a build file in a subdirectory of
192        this component.
193        ================================================================= -->
194   <target name="build.configured.apps">
195     <forEachApp names="${org.bedework.install.app.names}"
196                 prefix="org.bedework.deploy"
197                 appPrefix="org.bedework.app"
198                 projectPrefix="org.bedework.project">
199       <sequential>
200         <antcall target="build.available.configured.app" inheritrefs="true" />
201       </sequential>
202     </forEachApp>
203
204     <!-- ======================= termination tasks ================= -->
205
206     <ant antfile="${org.bedework.deployment.base}/termination/build.xml"
207          inheritrefs="true" target="build.configured" />
208   </target>
209
210   <target name="build.available.configured.app">
211     <propertycopy name="propval.app.type"
212                   from="bedework-options.org.bedework.app.${org.bedework.deploy.name}.appType" />
213     <property name="org.bedework.deploy.type.dir"
214               location="${app.root.dir}/${org.bedework.deploy.name}/${propval.app.type}" />
215     <echo message="*********************************** deploy directory is ${org.bedework.deploy.type.dir}" />
216
217     <if>
218       <available file="${org.bedework.deploy.type.dir}/${org.bedework.deploy.kind}/build.xml"/>
219       <then>
220         <propertyset id="deploy-app-properties">
221           <propertyref prefix="org.bedework.app.${org.bedework.deploy.name}"/>
222           <globmapper from="org.bedework.app.${org.bedework.deploy.name}.*" to="propval.app.*"/>
223         </propertyset>
224
225         <propertycopy name="propval.app.unauthenticated"
226                       from="bedework-options.org.bedework.app.${org.bedework.deploy.name}.guestMode" />
227
228         <ant antfile="${org.bedework.deploy.type.dir}/${org.bedework.deploy.kind}/build.xml"
229              inheritrefs="true" target="build.configured" >
230           <propertyset refid="deploy-app-properties" />
231         </ant>
232       </then>
233     </if>
234   </target>
235
236   <target name="deploy.apps">
237     <forEachApp names="${org.bedework.install.app.names}"
238                 prefix="org.bedework.deploy"
239                 appPrefix="org.bedework.app"
240                 projectPrefix="org.bedework.project">
241       <sequential>
242         <antcall target="deploy.available.app" inheritrefs="true" />
243       </sequential>
244     </forEachApp>
245
246     <!-- ======================= termination tasks ================= -->
247
248     <ant antfile="${org.bedework.deployment.base}/termination/${org.bedework.deploy.kind}/build.xml"
249          inheritrefs="true" target="deploy" />
250   </target>
251
252   <target name="deploy.available.app">
253     <propertycopy name="propval.app.type"
254                   from="bedework-options.org.bedework.app.${org.bedework.deploy.name}.appType" />
255     <property name="org.bedework.deploy.type.dir"
256               location="${app.root.dir}/${propval.app.type}" />
257     <echo message="*********************************** deploy directory is ${org.bedework.deploy.type.dir}" />
258
259     <if>
260       <available file="${org.bedework.deploy.type.dir}/${org.bedework.deploy.kind}/build.xml"/>
261       <then>
262         <propertyset id="deploy-app-properties">
263           <propertyref prefix="org.bedework.app.${org.bedework.deploy.name}"/>
264           <globmapper from="org.bedework.app.${org.bedework.deploy.name}.*" to="propval.app.*"/>
265         </propertyset>
266
267         <propertycopy name="propval.app.unauthenticated"
268                       from="bedework-options.org.bedework.app.${org.bedework.deploy.name}.guestMode" />
269
270         <ant antfile="${org.bedework.deploy.type.dir}/${org.bedework.deploy.kind}/build.xml"
271              inheritrefs="true" target="deploy" >
272           <propertyset refid="deploy-app-properties" />
273         </ant>
274       </then>
275     </if>
276   </target>
277 </project>
278
Note: See TracBrowser for help on using the browser.