root/trunk/deployment/build.xml

Revision 1581 (checked in by douglm, 6 years ago)

Remove deploy.properties file

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     <!-- Load the location of the libraries -->
31     <property file="${org.bedework.project.bedework}/build/libjars.properties" />
32
33   <target name="init" >
34     <dirname property="this.build.dir" file="${ant.file}"/>
35
36     <property name="source.home" location="${this.build.dir}/src"/>
37
38     <!-- Load default deploy properties
39     <property file="${this.build.dir}/deploy.properties"/>
40      -->
41
42     <!-- ==================== config properties ========================= -->
43     <property name="org.bedework.config.properties"
44               location="${org.bedework.config.base}/configs/democal.properties" />
45     <property name="org.bedework.config.options"
46               location="${org.bedework.config.base}/configs/democal.options.xml" />
47
48     <echo message="==========================================================" />
49     <echo message="Use config properties ${org.bedework.config.properties}" />
50     <loadproperties
51           srcFile="${org.bedework.config.properties}" >
52       <filterchain>
53         <expandproperties/>
54       </filterchain>
55     </loadproperties>
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
68     <!-- ==================== config properties =========================
69     <property name="org.bedework.config.properties"
70               location="${org.bedework.config.base}/configs/${org.bedework.clone.name}.properties" />
71
72     <echo message="==========================================================" />
73     <echo message="Use clone properties ${org.bedework.config.properties}" />
74     <loadproperties
75           srcFile="${org.bedework.config.properties}" >
76       <filterchain>
77         <expandproperties/>
78       </filterchain>
79     </loadproperties>
80     -->
81   </target>
82
83   <target name="deftasks" depends="init">
84     <path id="app.xml.cp">
85       <pathelement location="${org.bedework.deployutil.jar}"/>
86     </path>
87
88     <taskdef name="forEachApp"
89              classname="org.bedework.deployment.ForEachAppTask">
90       <classpath refid="app.xml.cp"/>
91     </taskdef>
92
93     <taskdef name="resolveFile"
94              classname="org.bedework.deployment.ResolveFile">
95       <classpath refid="app.xml.cp"/>
96     </taskdef>
97   </target>
98
99   <target name="build.configured" depends="deftasks" >
100     <!-- Clean up before we start -->
101     <delete dir="${org.bedework.temp.wars.home}" />
102
103     <antcall target="build.standalone.apps" inheritrefs="true" />
104
105     <antcall target="build.portal.apps" inheritrefs="true" />
106
107     <antcall target="build.j2ee.apps" inheritrefs="true" />
108   </target>
109
110   <!-- =================================================================
111        Targets called by the build.configured target. Each is conditional on a
112        config property and each executes a build file in a subdirectory of
113        this component.
114        ================================================================= -->
115
116   <target name="build.standalone.apps" if="org.bedework.global.build.standalone.app" >
117     <!-- ======================= webconfig - only standalone =================
118     <ant antfile="${org.bedework.deployment.base}/webconfig/webapp/build.xml"
119          inheritrefs="true" target="build.configured" />
120           -->
121
122     <property name="org.bedework.deploy.kind" value="webapp" />
123     <antcall target="build.configured.apps" inheritrefs="true" />
124   </target>
125
126   <target name="build.portal.apps" if="org.bedework.global.portal.platform" >
127     <property name="org.bedework.deploy.kind"
128               value="${org.bedework.global.portal.platform}" />
129     <antcall target="build.configured.apps" inheritrefs="true" />
130   </target>
131
132   <target name="build.j2ee.apps" if="org.bedework.global.j2ee.platform" >
133     <property name="org.bedework.deploy.kind"
134               value="${org.bedework.global.j2ee.platform}" />
135     <antcall target="build.configured.apps" inheritrefs="true" />
136   </target>
137
138   <!-- =================================================================
139                          The deploy target.
140        ================================================================= -->
141
142   <target name="deploy" depends="deftasks" >
143     <!-- Clean up before we start -->
144     <delete dir="${org.bedework.temp.wars.home}" />
145
146     <!--<antcall target="deploy.standalone.apps" inheritrefs="true" />-->
147     <if>
148       <isset property="org.bedework.global.build.standalone.app" />
149       <then>
150         <antcall target="deploy.apps" inheritrefs="true" >
151           <param name="org.bedework.deploy.kind" value="webapp" />
152         </antcall>
153       </then>
154     </if>
155
156     <!--<antcall target="deploy.shellscr.apps" inheritrefs="true" />-->
157     <!-- Always build the shellscr stuff.-->
158     <antcall target="deploy.apps" inheritrefs="true" >
159       <param name="org.bedework.deploy.kind" value="shellscr" />
160     </antcall>
161
162     <!-- <antcall target="deploy.portal.apps" inheritrefs="true" />-->
163     <if>
164       <isset property="org.bedework.global.portal.platform" />
165       <then>
166         <antcall target="deploy.apps" inheritrefs="true" >
167           <param name="org.bedework.deploy.kind"
168                  value="${org.bedework.global.portal.platform}" />
169         </antcall>
170       </then>
171     </if>
172
173     <!-- <antcall target="deploy.j2ee.apps" inheritrefs="true" />-->
174     <if>
175       <isset property="org.bedework.global.j2ee.platform" />
176       <then>
177         <antcall target="deploy.apps" inheritrefs="true" >
178           <param name="org.bedework.deploy.kind"
179                  value="${org.bedework.global.j2ee.platform}" />
180         </antcall>
181       </then>
182     </if>
183
184     <!-- copy startup website that sends you to the applications -->
185     <delete dir="${webapp.root.dir}/bedework"/>
186     <mkdir dir="${webapp.root.dir}/bedework"/>
187     <copy todir="${webapp.root.dir}/bedework">
188       <fileset dir="${app.root.dir}/resources/bedework"/>
189     </copy>
190
191     <!-- copy libs that the application server needs -->
192     <antcall target="deploy.appserver.jdbcdriver" inheritrefs="true" />
193     <antcall target="deploy.appserver.javatools" inheritrefs="true" />
194   </target>
195
196   <!-- =================================================================
197        Targets called by the deploy target. Each is conditional on a
198        config property and each executes a build file in a subdirectory of
199        this component.
200        ================================================================= -->
201
202   <!-- The cp.xalan task conditionally copies the xalan.jar file, if
203        necessary -->
204   <target name="cp.xalan" if="xalan.in.tomcat.common.endorsed">
205     <copy file="${org.bedework.default.lib}/xalan.jar"
206           todir="${appserver.endorsed.dir}"/>
207   </target>
208
209   <target name="deploy.appserver.jdbcdriver"
210           if="appserver.jdbcdriver.jar" >
211     <!-- copy jdbc jar so datasources work -->
212     <copy todir="${appserver.lib.dir}" file="${appserver.jdbcdriver.jar}"/>
213   </target>
214
215   <target name="deploy.appserver.javatools"
216           if="java.tools.jar" >
217     <!-- copy tools jar so jsps work -->
218     <copy todir="${appserver.lib.dir}" file="${java.tools.jar}"/>
219   </target>
220
221   <!-- =================================================================
222        Targets called by the build.configured target. Each is conditional on a
223        config property and each executes a build file in a subdirectory of
224        this component.
225        ================================================================= -->
226   <target name="build.configured.apps">
227     <forEachApp names="${org.bedework.install.app.names}"
228                 prefix="org.bedework.deploy"
229                 appPrefix="org.bedework.app"
230                 projectPrefix="org.bedework.project">
231       <sequential>
232         <available file="${org.bedework.deploy.type.dir}/${org.bedework.deploy.kind}/build.xml"
233                    property="app.kind.available" />
234         <antcall target="build.available.configured.app" inheritrefs="true" />
235       </sequential>
236     </forEachApp>
237
238     <!-- ======================= termination tasks ================= -->
239     <!--
240     <property name="org.bedework.deploy.type.dir"
241               location="${org.bedework.deployment.base}/termination" />
242               -->
243
244     <ant antfile="${org.bedework.deployment.base}/termination/build.xml"
245          inheritrefs="true" target="build.configured" />
246   </target>
247
248   <target name="build.available.configured.app" if="app.kind.available">
249     <!-- Pick out the application build properties based on the prefix "org.bedework.app."
250          and the deployment name -->
251     <propertyset id="build-app-properties">
252       <propertyref prefix="org.bedework.app.${org.bedework.deploy.name}"/>
253       <globmapper from="org.bedework.app.${org.bedework.deploy.name}.*" to="propval.app.*"/>
254     </propertyset>
255   </target>
256
257   <target name="deploy.apps">
258     <forEachApp names="${org.bedework.install.app.names}"
259                 prefix="org.bedework.deploy"
260                 appPrefix="org.bedework.app"
261                 projectPrefix="org.bedework.project">
262       <sequential>
263         <antcall target="deploy.available.app" inheritrefs="true" />
264       </sequential>
265     </forEachApp>
266
267     <!-- ======================= termination tasks ================= -->
268
269     <ant antfile="${org.bedework.deployment.base}/termination/${org.bedework.deploy.kind}/build.xml"
270          inheritrefs="true" target="deploy" />
271   </target>
272
273   <target name="deploy.available.app">
274     <if>
275       <available file="${org.bedework.deploy.type.dir}/${org.bedework.deploy.kind}/build.xml"/>
276       <then>
277         <propertyset id="deploy-app-properties">
278           <propertyref prefix="org.bedework.app.${org.bedework.deploy.name}"/>
279           <globmapper from="org.bedework.app.${org.bedework.deploy.name}.*" to="propval.app.*"/>
280         </propertyset>
281
282         <ant antfile="${org.bedework.deploy.type.dir}/${org.bedework.deploy.kind}/build.xml"
283              inheritrefs="true" target="deploy" >
284           <propertyset refid="deploy-app-properties" />
285         </ant>
286       </then>
287     </if>
288   </target>
289 </project>
290
Note: See TracBrowser for help on using the browser.