| 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}/buildTools/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 |
<loadDeployConfig /> |
|---|
| 54 |
|
|---|
| 55 |
<!-- default to debug off --> |
|---|
| 56 |
<property name="app.debug.val" value="0" /> |
|---|
| 57 |
|
|---|
| 58 |
<!-- set this for the war builds --> |
|---|
| 59 |
<dirname property="app.root.dir" file="${ant.file}"/> |
|---|
| 60 |
|
|---|
| 61 |
<!-- Common resources directory --> |
|---|
| 62 |
<property name="org.bedework.common.resources" |
|---|
| 63 |
location="${app.root.dir}/resources" /> |
|---|
| 64 |
|
|---|
| 65 |
<property name="org.bedework.global.build.common.context.war.name" |
|---|
| 66 |
value="bw-common" /> |
|---|
| 67 |
|
|---|
| 68 |
<!-- Where we put ear stuff --> |
|---|
| 69 |
<if> |
|---|
| 70 |
<isset property="org.bedework.global.build.ear" /> |
|---|
| 71 |
<then> |
|---|
| 72 |
<property name="app.ear.file.name" |
|---|
| 73 |
value="${org.bedework.global.ear.name}.ear" /> |
|---|
| 74 |
|
|---|
| 75 |
<if> |
|---|
| 76 |
<equals arg1="${org.bedework.global.ear.zipped}" |
|---|
| 77 |
arg2="yes" /> |
|---|
| 78 |
<then> |
|---|
| 79 |
<property name="org.bedework.ear.dir" |
|---|
| 80 |
location="${dist.home}/${org.bedework.global.ear.name}" /> |
|---|
| 81 |
<property name="org.bedework.ear.file" |
|---|
| 82 |
location="${dist.home}/${org.bedework.global.ear.name}.ear" /> |
|---|
| 83 |
</then> |
|---|
| 84 |
<else> |
|---|
| 85 |
<property name="org.bedework.ear.dir" |
|---|
| 86 |
location="${dist.home}/${org.bedework.global.ear.name}.ear" /> |
|---|
| 87 |
</else> |
|---|
| 88 |
</if> |
|---|
| 89 |
|
|---|
| 90 |
<!-- |
|---|
| 91 |
<property name="org.bedework.ear.templib" |
|---|
| 92 |
location="${org.bedework.ear.dir}/lib" /> |
|---|
| 93 |
--> |
|---|
| 94 |
<property name="org.bedework.ear.templib" |
|---|
| 95 |
location="${org.bedework.temp.dir}/earlib" /> |
|---|
| 96 |
<property name="org.bedework.ear.properties.dir" |
|---|
| 97 |
location="${org.bedework.temp.dir}/ear-properties" /> |
|---|
| 98 |
|
|---|
| 99 |
<property name="org.bedework.ear.properties.jar" |
|---|
| 100 |
location="${org.bedework.ear.dir}/bw-ear-properties.jar"/> |
|---|
| 101 |
|
|---|
| 102 |
<delete dir="${org.bedework.ear.dir}" /> |
|---|
| 103 |
<mkdir dir="${org.bedework.ear.dir}" /> |
|---|
| 104 |
|
|---|
| 105 |
<delete dir="${org.bedework.ear.templib}" /> |
|---|
| 106 |
<mkdir dir="${org.bedework.ear.templib}" /> |
|---|
| 107 |
|
|---|
| 108 |
<delete dir="${org.bedework.ear.properties.dir}" /> |
|---|
| 109 |
<mkdir dir="${org.bedework.ear.properties.dir}" /> |
|---|
| 110 |
</then> |
|---|
| 111 |
</if> |
|---|
| 112 |
|
|---|
| 113 |
<property name="org.bedework.global.context.roots" |
|---|
| 114 |
location="${org.bedework.temp.dir}/context-roots.properties" /> |
|---|
| 115 |
|
|---|
| 116 |
<if> |
|---|
| 117 |
<not> |
|---|
| 118 |
<isset property="org.bedework.global.context.roots" /> |
|---|
| 119 |
</not> |
|---|
| 120 |
<then> |
|---|
| 121 |
<tempfile property="org.bedework.global.context.roots" |
|---|
| 122 |
destdir="${org.bedework.temp.dir}" |
|---|
| 123 |
prefix="context-roots" suffix=".properties" /> |
|---|
| 124 |
</then> |
|---|
| 125 |
</if> |
|---|
| 126 |
</target> |
|---|
| 127 |
|
|---|
| 128 |
<target name="deftasks" depends="init"> |
|---|
| 129 |
<path id="app.xml.cp"> |
|---|
| 130 |
<pathelement location="${org.bedework.deployutil.jar}"/> |
|---|
| 131 |
</path> |
|---|
| 132 |
|
|---|
| 133 |
<taskdef name="forEachApp" |
|---|
| 134 |
classname="org.bedework.deployment.ForEachAppTask"> |
|---|
| 135 |
<classpath refid="app.xml.cp"/> |
|---|
| 136 |
</taskdef> |
|---|
| 137 |
|
|---|
| 138 |
<taskdef name="resolveFile" |
|---|
| 139 |
classname="org.bedework.deployment.ResolveFile"> |
|---|
| 140 |
<classpath refid="app.xml.cp"/> |
|---|
| 141 |
</taskdef> |
|---|
| 142 |
|
|---|
| 143 |
<taskdef name="makeLangXsl" |
|---|
| 144 |
classname="org.bedework.deployment.MakeLangXsl"> |
|---|
| 145 |
<classpath refid="app.xml.cp"/> |
|---|
| 146 |
</taskdef> |
|---|
| 147 |
</target> |
|---|
| 148 |
|
|---|
| 149 |
<target name="build.configured" depends="deftasks" > |
|---|
| 150 |
<!-- Clean up before we start --> |
|---|
| 151 |
<delete dir="${org.bedework.temp.wars.home}" /> |
|---|
| 152 |
|
|---|
| 153 |
<antcall target="build.apps" inheritrefs="true" /> |
|---|
| 154 |
</target> |
|---|
| 155 |
|
|---|
| 156 |
<!-- ================================================================= |
|---|
| 157 |
Targets called by the build.configured target. Each is conditional on a |
|---|
| 158 |
config property and each executes a build file in a subdirectory of |
|---|
| 159 |
this component. |
|---|
| 160 |
================================================================= --> |
|---|
| 161 |
|
|---|
| 162 |
<target name="build.apps" > |
|---|
| 163 |
<property name="org.bedework.deploy.kind" value="webapp" /> |
|---|
| 164 |
<antcall target="build.configured.apps" inheritrefs="true" /> |
|---|
| 165 |
</target> |
|---|
| 166 |
|
|---|
| 167 |
<!-- ================================================================= |
|---|
| 168 |
The deploy target. |
|---|
| 169 |
================================================================= --> |
|---|
| 170 |
|
|---|
| 171 |
<target name="deploy" depends="deftasks" > |
|---|
| 172 |
<!-- Clean up before we start --> |
|---|
| 173 |
<delete dir="${org.bedework.temp.wars.home}" /> |
|---|
| 174 |
|
|---|
| 175 |
<property name="org.bedework.lang.properties" |
|---|
| 176 |
location="${org.bedework.project.calendarapi}/calFacade/resources/org/bedework/locale/resources" /> |
|---|
| 177 |
|
|---|
| 178 |
<property name="org.bedework.xsllang.dir" |
|---|
| 179 |
location="${org.bedework.temp.dir}/xsllang" /> |
|---|
| 180 |
|
|---|
| 181 |
<delete dir="${org.bedework.xsllang.dir}"/> |
|---|
| 182 |
<mkdir dir="${org.bedework.xsllang.dir}"/> |
|---|
| 183 |
|
|---|
| 184 |
<makeLangXsl dir="${org.bedework.lang.properties}" |
|---|
| 185 |
prefix="BwResources" |
|---|
| 186 |
resdir="${org.bedework.xsllang.dir}" |
|---|
| 187 |
xsldir="${org.bedework.xsllang.dir}" |
|---|
| 188 |
name="org.bedework.locales" |
|---|
| 189 |
check="true" /> |
|---|
| 190 |
|
|---|
| 191 |
<!-- Build the webapps stuff.--> |
|---|
| 192 |
<antcall target="deploy.apps" inheritrefs="true" > |
|---|
| 193 |
<param name="org.bedework.deploy.kind" value="webapp" /> |
|---|
| 194 |
</antcall> |
|---|
| 195 |
|
|---|
| 196 |
<!-- Build the shellscr stuff.--> |
|---|
| 197 |
<antcall target="deploy.apps" inheritrefs="true" > |
|---|
| 198 |
<param name="org.bedework.deploy.kind" value="shellscr" /> |
|---|
| 199 |
</antcall> |
|---|
| 200 |
|
|---|
| 201 |
<!-- copy startup website that sends you to the applications --> |
|---|
| 202 |
<delete dir="${webapp.root.dir}/bedework"/> |
|---|
| 203 |
<mkdir dir="${webapp.root.dir}/bedework"/> |
|---|
| 204 |
<copy todir="${webapp.root.dir}/bedework"> |
|---|
| 205 |
<fileset dir="${app.root.dir}/resources/bedework"/> |
|---|
| 206 |
</copy> |
|---|
| 207 |
|
|---|
| 208 |
<!-- copy jdbc jar so datasources work --> |
|---|
| 209 |
<if> |
|---|
| 210 |
<available file="${org.bedework.global.ext.lib}/jdbc" type="dir" /> |
|---|
| 211 |
<then> |
|---|
| 212 |
<!-- jdbc drivers --> |
|---|
| 213 |
<copy todir="${appserver.lib.dir}" flatten="yes" > |
|---|
| 214 |
<!-- local jdbc drivers --> |
|---|
| 215 |
<fileset dir="${org.bedework.global.ext.lib}/jdbc"> |
|---|
| 216 |
<include name="*.jar"/> |
|---|
| 217 |
</fileset> |
|---|
| 218 |
</copy> |
|---|
| 219 |
</then> |
|---|
| 220 |
<else> |
|---|
| 221 |
<!-- Include the quickstart jdbc driver --> |
|---|
| 222 |
<copy todir="${appserver.lib.dir}" file="${org.bedework.appjar.hsqldb}"/> |
|---|
| 223 |
</else> |
|---|
| 224 |
</if> |
|---|
| 225 |
|
|---|
| 226 |
<if> |
|---|
| 227 |
<available file="${java.tools.jar}" /> |
|---|
| 228 |
<then> |
|---|
| 229 |
<copy todir="${appserver.lib.dir}" file="${java.tools.jar}"/> |
|---|
| 230 |
</then> |
|---|
| 231 |
</if> |
|---|
| 232 |
</target> |
|---|
| 233 |
|
|---|
| 234 |
<!-- ================================================================= |
|---|
| 235 |
Targets called by the deploy target. Each is conditional on a |
|---|
| 236 |
config property and each executes a build file in a subdirectory of |
|---|
| 237 |
this component. |
|---|
| 238 |
================================================================= --> |
|---|
| 239 |
|
|---|
| 240 |
<!-- The cp.xalan task conditionally copies the xalan.jar file, if |
|---|
| 241 |
necessary --> |
|---|
| 242 |
<target name="cp.xalan" if="xalan.in.tomcat.common.endorsed"> |
|---|
| 243 |
<copy file="${org.bedework.default.lib}/xalan.jar" |
|---|
| 244 |
todir="${appserver.endorsed.dir}"/> |
|---|
| 245 |
</target> |
|---|
| 246 |
|
|---|
| 247 |
<!-- ================================================================= |
|---|
| 248 |
Targets called by the build.configured target. Each is conditional on a |
|---|
| 249 |
config property and each executes a build file in a subdirectory of |
|---|
| 250 |
this component. |
|---|
| 251 |
================================================================= --> |
|---|
| 252 |
<target name="build.configured.apps"> |
|---|
| 253 |
<forEachApp names="${org.bedework.install.app.names}" |
|---|
| 254 |
prefix="org.bedework.deploy" |
|---|
| 255 |
appPrefix="org.bedework.app" |
|---|
| 256 |
projectPrefix="org.bedework.project"> |
|---|
| 257 |
<sequential> |
|---|
| 258 |
<antcall target="build.available.configured.app" inheritrefs="true" /> |
|---|
| 259 |
</sequential> |
|---|
| 260 |
</forEachApp> |
|---|
| 261 |
|
|---|
| 262 |
<!-- ======================= termination tasks ================= --> |
|---|
| 263 |
|
|---|
| 264 |
<ant antfile="${org.bedework.deployment.base}/termination/build.xml" |
|---|
| 265 |
inheritrefs="true" target="build.configured" /> |
|---|
| 266 |
</target> |
|---|
| 267 |
|
|---|
| 268 |
<target name="build.available.configured.app"> |
|---|
| 269 |
<propertycopy name="propval.app.type" |
|---|
| 270 |
from="bedework-options.org.bedework.app.${org.bedework.deploy.name}.appType" /> |
|---|
| 271 |
<property name="org.bedework.deploy.type.dir" |
|---|
| 272 |
location="${app.root.dir}/${org.bedework.deploy.name}/${propval.app.type}" /> |
|---|
| 273 |
<echo message="*********************************** deploy directory is ${org.bedework.deploy.type.dir}" /> |
|---|
| 274 |
|
|---|
| 275 |
<if> |
|---|
| 276 |
<available file="${org.bedework.deploy.type.dir}/${org.bedework.deploy.kind}/build.xml"/> |
|---|
| 277 |
<then> |
|---|
| 278 |
<propertyset id="deploy-app-properties"> |
|---|
| 279 |
<propertyref prefix="org.bedework.app.${org.bedework.deploy.name}"/> |
|---|
| 280 |
<globmapper from="org.bedework.app.${org.bedework.deploy.name}.*" to="propval.app.*"/> |
|---|
| 281 |
</propertyset> |
|---|
| 282 |
|
|---|
| 283 |
<propertycopy name="propval.app.unauthenticated" |
|---|
| 284 |
from="bedework-options.org.bedework.app.${org.bedework.deploy.name}.guestMode" /> |
|---|
| 285 |
|
|---|
| 286 |
<ant antfile="${org.bedework.deploy.type.dir}/${org.bedework.deploy.kind}/build.xml" |
|---|
| 287 |
inheritrefs="true" target="build.configured" > |
|---|
| 288 |
<propertyset refid="deploy-app-properties" /> |
|---|
| 289 |
</ant> |
|---|
| 290 |
</then> |
|---|
| 291 |
</if> |
|---|
| 292 |
</target> |
|---|
| 293 |
|
|---|
| 294 |
<target name="deploy.apps"> |
|---|
| 295 |
<forEachApp names="${org.bedework.install.app.names}" |
|---|
| 296 |
prefix="org.bedework.deploy" |
|---|
| 297 |
appPrefix="org.bedework.app" |
|---|
| 298 |
projectPrefix="org.bedework.project"> |
|---|
| 299 |
<sequential> |
|---|
| 300 |
<antcall target="deploy.available.app" inheritrefs="true" /> |
|---|
| 301 |
</sequential> |
|---|
| 302 |
</forEachApp> |
|---|
| 303 |
|
|---|
| 304 |
<!-- ======================= termination tasks ================= --> |
|---|
| 305 |
|
|---|
| 306 |
<ant antfile="${org.bedework.deployment.base}/termination/${org.bedework.deploy.kind}/build.xml" |
|---|
| 307 |
inheritrefs="true" target="deploy" /> |
|---|
| 308 |
</target> |
|---|
| 309 |
|
|---|
| 310 |
<target name="deploy.available.app"> |
|---|
| 311 |
<propertycopy name="propval.app.type" |
|---|
| 312 |
from="bedework-options.org.bedework.app.${org.bedework.deploy.name}.appType" /> |
|---|
| 313 |
<property name="org.bedework.deploy.type.dir" |
|---|
| 314 |
location="${app.root.dir}/${propval.app.type}" /> |
|---|
| 315 |
<echo message="*********************************** deploy directory is ${org.bedework.deploy.type.dir}" /> |
|---|
| 316 |
|
|---|
| 317 |
<if> |
|---|
| 318 |
<available file="${org.bedework.deploy.type.dir}/${org.bedework.deploy.kind}/build.xml"/> |
|---|
| 319 |
<then> |
|---|
| 320 |
<propertyset id="deploy-app-properties"> |
|---|
| 321 |
<propertyref prefix="org.bedework.app.${org.bedework.deploy.name}"/> |
|---|
| 322 |
<globmapper from="org.bedework.app.${org.bedework.deploy.name}.*" to="propval.app.*"/> |
|---|
| 323 |
</propertyset> |
|---|
| 324 |
|
|---|
| 325 |
<propertycopy name="propval.app.unauthenticated" |
|---|
| 326 |
from="bedework-options.org.bedework.app.${org.bedework.deploy.name}.guestMode" /> |
|---|
| 327 |
|
|---|
| 328 |
<ant antfile="${org.bedework.deploy.type.dir}/${org.bedework.deploy.kind}/build.xml" |
|---|
| 329 |
inheritrefs="true" target="deploy" > |
|---|
| 330 |
<propertyset refid="deploy-app-properties" /> |
|---|
| 331 |
</ant> |
|---|
| 332 |
</then> |
|---|
| 333 |
</if> |
|---|
| 334 |
</target> |
|---|
| 335 |
</project> |
|---|
| 336 |
|
|---|