Weitere Modifikation des BUILD Systems:

* das verwendete Bundle-Verzeichnis wird bei deploy nach WEB-INF/bin/bundle kopiert
* load-bundle greift jetzt darauf zu, nicht mehr auf ccm.bundle.folder und ccm-*-aplaws/bundle
* load tasks sind systematisiert:
  *  load-bundle:  verarbeitet db und config automatisch nach bundle files
  *  load-bundle-interactive:  verarbeitet db und config, fragt required parameter ab
  *  load-bundle-config:  verarbeitet nur config automatisch nach bundle files
  *  load-bundle-config-interactive: verarbeitet nur config, fragt required parameter ab
  *  load-bundle-data:  verarbeitet nur db automatisch nach bundle files

Das ist weiterer Schritt zu einem neuen Installationssystem.


git-svn-id: https://svn.libreccm.org/ccm/trunk@1058 8810af33-2d31-482b-a856-94f89814c4df
master
pb 2011-08-12 10:09:52 +00:00
parent 962227d4e6
commit 98141ba556
5 changed files with 111 additions and 33 deletions

View File

@ -731,6 +731,7 @@ public class Application extends Resource {
return URL.SERVLET_DIR + "/legacy-adapter"; return URL.SERVLET_DIR + "/legacy-adapter";
} }
@Override
protected void beforeSave() { protected void beforeSave() {
if (isPropertyModified(PRIMARY_URL) || isNew()) { if (isPropertyModified(PRIMARY_URL) || isNew()) {
BaseDispatcher.scheduleRefresh(); BaseDispatcher.scheduleRefresh();
@ -740,6 +741,7 @@ public class Application extends Resource {
} }
// This should be done through PDL // This should be done through PDL
@Override
public void beforeDelete() { public void beforeDelete() {
super.beforeDelete(); super.beforeDelete();
SiteNode node = getSiteNode(); SiteNode node = getSiteNode();
@ -748,6 +750,7 @@ public class Application extends Resource {
} }
} }
@Override
public void afterDelete() { public void afterDelete() {
BaseDispatcher.scheduleRefresh(); BaseDispatcher.scheduleRefresh();
} }
@ -796,6 +799,7 @@ public class Application extends Resource {
// if application name changes, change name of container group // if application name changes, change name of container group
@Override
public void setTitle (String title) { public void setTitle (String title) {
super.setTitle(title); super.setTitle(title);
Group containerGroup = getGroup(); Group containerGroup = getGroup();

View File

@ -150,7 +150,7 @@ waf.admin.password=123456
waf.admin.password.question=12345 waf.admin.password.question=12345
waf.admin.password.answer=6 waf.admin.password.answer=6
waf.runtime.jdbc_url=jdbc\:postgresql\://localhost/ccm?user\=ccm&password\=ccm waf.runtime.jdbc_url=jdbc\:postgresql\://localhost/ccm-pb?user\=ccm&password\=ccm
waf.runtime.jdbc_pool_size=60 waf.runtime.jdbc_pool_size=60
waf.web.server=localhost\:8080 waf.web.server=localhost\:8080

View File

@ -176,6 +176,10 @@
<property value="com.arsdigita.persistence.pdl.PDL" name="ddl.generator.classname"/> <property value="com.arsdigita.persistence.pdl.PDL" name="ddl.generator.classname"/>
<property value="com.arsdigita.persistence.pdl.TestPDLGenerator" name="test.ddl.generator.classname"/> <property value="com.arsdigita.persistence.pdl.TestPDLGenerator" name="test.ddl.generator.classname"/>
<!-- Determines the web.xml file to use. If the project.xml file contains
a ccm:project/webxml property this name is used to search for the file
in later steps. Otherwise the name is set to the stub file web.xml-core
-->
<xsl:choose> <xsl:choose>
<xsl:when test="@webxml"> <xsl:when test="@webxml">
<property name="webxml.source.file"> <property name="webxml.source.file">
@ -697,7 +701,7 @@
<exclude name="**/package.html"/> <exclude name="**/package.html"/>
<exclude name="**/*.java"/> <exclude name="**/*.java"/>
<!-- exclude files which are no longer used - during <!-- exclude files which are no longer used - during
transation and code clean-up phase only --> transition and code clean-up phase only -->
<exclude name="**/*.java.nolongerInUse"/> <exclude name="**/*.java.nolongerInUse"/>
<exclude name="**/**.nolongerInUse"/> <exclude name="**/**.nolongerInUse"/>
</fileset> </fileset>
@ -816,7 +820,9 @@
<xsl:param name="sourcexml"/> <xsl:param name="sourcexml"/>
<mkdir dir="{$name}/${{build.sql.dir}}/${{apps.{$name}.name}}/${{ddl.dir}}/{$database}"/> <mkdir dir="{$name}/${{build.sql.dir}}/${{apps.{$name}.name}}/${{ddl.dir}}/{$database}"/>
<java failonerror="yes" classname="${{ddl.generator.classname}}" fork="yes"> <java failonerror="yes" classname="${{ddl.generator.classname}}" fork="yes">
<!-- TESTING
<sysproperty key="java.ext.dirs" value="${{ccm.java.ext.dirs}}"/> <sysproperty key="java.ext.dirs" value="${{ccm.java.ext.dirs}}"/>
-->
<classpath refid="{$name}.build.classpath"/> <classpath refid="{$name}.build.classpath"/>
<arg line="-quiet"/> <arg line="-quiet"/>
<arg line="-generate-ddl {$name}/${{build.sql.dir}}/${{apps.{$name}.name}}/${{ddl.dir}}/{$database}"/> <arg line="-generate-ddl {$name}/${{build.sql.dir}}/${{apps.{$name}.name}}/${{ddl.dir}}/{$database}"/>
@ -880,7 +886,9 @@
<target name="verify-pdl" depends="init" unless="pdl.no.verify" <target name="verify-pdl" depends="init" unless="pdl.no.verify"
description="Verifies that the PDL files compile"> description="Verifies that the PDL files compile">
<java classname="${{ddl.generator.classname}}" failonerror="yes" fork="yes"> <java classname="${{ddl.generator.classname}}" failonerror="yes" fork="yes">
<!-- TESTING
<sysproperty key="java.ext.dirs" value="${{ccm.java.ext.dirs}}"/> <sysproperty key="java.ext.dirs" value="${{ccm.java.ext.dirs}}"/>
-->
<classpath refid="server.build.classpath"/> <classpath refid="server.build.classpath"/>
<arg line="${{pdl.args}}"/> <arg line="${{pdl.args}}"/>
<xsl:call-template name="TargetPdlPath"> <xsl:call-template name="TargetPdlPath">
@ -1207,8 +1215,11 @@
</not> </not>
</and> </and>
</condition> </condition>
<condition property="resolved.webxml.source.file" value="${{webxml.source.file}}"> <condition property="resolved.webxml.source.file"
<not><isset property="resolved.webxml.source.file"/></not> value="${{webxml.source.file}}">
<not>
<isset property="resolved.webxml.source.file"/>
</not>
</condition> </condition>
<echo message="web.xml to use: ${{this.deploy.dir}}/WEB-INF/${{webxml.source.file}}" /> <echo message="web.xml to use: ${{this.deploy.dir}}/WEB-INF/${{webxml.source.file}}" />
</target> </target>
@ -1256,12 +1267,41 @@
<delete file="${{mergedWebXML}}"/> <delete file="${{mergedWebXML}}"/>
</target> </target>
<target name="copy-bundle-init" depends="init">
<available file="${{ccm.bundle.folder}}" type="dir"
property="root.bundle.exists"/>
<condition property="resolved.bundle.source.dir"
value="${{ccm.bundle.folder}}">
<and>
<isset property="root.bundle.exists"/>
<available file="${{this.deploy.dir}}/WEB-INF/bin"/>
</and>
</condition>
<echo message="Bundle to use: ${{resolved.bundle.source.dir}}" />
</target>
<!-- Copies the installation bundle actually used by this deploy to the
WEB-INF directory of the deploy target so it can be used by the
load-bundle step on the server machine and outside the development
environment. -->
<target name="copy-bundle"
depends="init,copy-bundle-init" if="root.webapp.exists">
<copy todir="${{this.deploy.dir}}/WEB-INF/bin/bundle" overwrite="yes">
<fileset dir="${{resolved.bundle.source.dir}}" />
</copy>
</target>
<!-- Master deploy --> <!-- Master deploy -->
<target name="deploy" <target name="deploy"
depends="init,deploy-global,deploy-local,copy-webxml"> depends="init,deploy-global,deploy-local,copy-webxml,copy-bundle">
<xsl:attribute name="description"> <xsl:attribute name="description">
Builds and deploys all applications, also deploys prebuilt applications and config files Builds and deploys all applications, also deploys prebuilt applications and config files
</xsl:attribute> </xsl:attribute>
<echo>Deploy completed!</echo>
</target> </target>
</xsl:template> <!-- TargetDeploy --> </xsl:template> <!-- TargetDeploy -->
@ -1397,7 +1437,7 @@
</xsl:for-each> </xsl:for-each>
<!-- Master package --> <!-- Master package -->
<!-- depends="init,deploy-global,deploy-local,copy-webxml" --> <!-- depends="init,deploy-global,deploy-local,copy-webxml" -->
<!-- Step through the list of modules and package each one built --> <!-- Step through the list of modules and package each one built -->
<target name="package"> <target name="package">
<xsl:attribute name="description"> <xsl:attribute name="description">
@ -1422,7 +1462,7 @@
<!-- Master step create-war --> <!-- Master step create-war -->
<!-- depends="init,deploy-global,deploy-local,copy-webxml" --> <!-- depends="init,deploy-global,deploy-local,copy-webxml" -->
<target name="create-war"> <target name="create-war">
<xsl:attribute name="description"> <xsl:attribute name="description">
Creates a WAR file of the deployed application. Creates a WAR file of the deployed application.
@ -1531,7 +1571,9 @@
<xsl:param name="sourcexml"/> <xsl:param name="sourcexml"/>
<mkdir dir="{$target}/${{build.test.sql.dir}}/${{ddl.dir}}/{$database}"/> <mkdir dir="{$target}/${{build.test.sql.dir}}/${{ddl.dir}}/{$database}"/>
<java failonerror="yes" classname="${{test.ddl.generator.classname}}" fork="yes"> <java failonerror="yes" classname="${{test.ddl.generator.classname}}" fork="yes">
<!-- TESTING
<sysproperty key="java.ext.dirs" value="${{ccm.java.ext.dirs}}"/> <sysproperty key="java.ext.dirs" value="${{ccm.java.ext.dirs}}"/>
-->
<classpath refid="{$target}.build.classpath"/> <classpath refid="{$target}.build.classpath"/>
<arg line="-quiet"/> <arg line="-quiet"/>
<arg line="-generate-ddl {$target}/${{build.test.sql.dir}}/{$database}"/> <arg line="-generate-ddl {$target}/${{build.test.sql.dir}}/{$database}"/>
@ -1863,6 +1905,8 @@
</xsl:for-each> </xsl:for-each>
</target> </target>
<!-- Generates Javadoc from included modules and stores it into its own
subdirectory dir -->
<target name="javadoc" depends="init,javadoc-combine-src" <target name="javadoc" depends="init,javadoc-combine-src"
description="Generates the combined API documentation"> description="Generates the combined API documentation">
<mkdir dir="${{javadoc.dir}}"/> <mkdir dir="${{javadoc.dir}}"/>
@ -1898,6 +1942,7 @@
</javadoc> </javadoc>
</target> </target>
<!-- Deploy junit test environment, currently not uptodate -->
<target name="deploy-test"> <target name="deploy-test">
<xsl:attribute name="depends"> <xsl:attribute name="depends">
<xsl:text>init</xsl:text> <xsl:text>init</xsl:text>
@ -2010,17 +2055,20 @@
</xsl:for-each> </xsl:for-each>
<!-- should be deprecated, TODO: check for usage --> <!-- should be deprecated, TODO: check for usage -->
<!-- TESTwise excluded
<path id="ccm.java.ext.dirs"> <path id="ccm.java.ext.dirs">
<!-- no longer present in APLAWS 1.0.4 < ! - - no longer present in APLAWS 1.0.4
<dirset dir="${{ccm.tools.dir}}"> <dirset dir="${{ccm.tools.dir}}">
<include name="lib/security"/> <include name="lib/security"/>
</dirset> </dirset>
--> - - >
<pathelement path="${{java.ext.dirs}}"/> <pathelement path="${{java.ext.dirs}}"/>
</path> </path>
<pathconvert dirsep="/" pathsep=":" property="ccm.java.ext.dirs" <pathconvert dirsep="/" pathsep=":" property="ccm.java.ext.dirs"
refid="ccm.java.ext.dirs"/> refid="ccm.java.ext.dirs"/>
-->
<condition property="junit.jvmargs" <condition property="junit.jvmargs"
value="-Xdebug -Xrunjdwp:transport=dt_socket,address=${{test.remote.port}}, value="-Xdebug -Xrunjdwp:transport=dt_socket,address=${{test.remote.port}},
server=y,suspend=y -Xnoagent -Djava.compiler=NONE"> server=y,suspend=y -Xnoagent -Djava.compiler=NONE">

View File

@ -3,35 +3,66 @@
<!-- Already definded: <!-- Already definded:
ccm.project.dir: base dir of the development project ccm.project.dir: base dir of the development project
app.server.bundles.zip name of the installation file app.server.bundles.zip name of the installation file
app.server.parent.dir name of the dir to install into the server into app.server.parent.dir name of the dir to install the server into
app.server.home.dir dir the server are installed into (i.e. CATALINA_HOME) app.server.home.dir dir the server is installed into (i.e. CATALINA_HOME)
app.server.deploy.dir dir the server are installed into (i.e. CATALINA_BASE) app.server.deploy.dir dir the server is installed into (i.e. CATALINA_BASE)
app.server.conf.dir name of the servers configuration dir app.server.conf.dir name of the servers configuration dir
app.server.webapp.dir distribution dir for web applications --> app.server.webapp.dir distribution dir for web applications -->
<project name="load"> <project name="load">
<target name="load-bundle" depends="prepare-load"> <target name="load-bundle" depends="prepare-load">
<echo>Loading bundle ${ccm.bundle.folder} into ${ccm.home}</echo> <echo>Loading bundle ${this.bundle.folder} into ${ccm.home}</echo>
<java classname="com.arsdigita.packaging.MasterTool" fork="yes"> <java classname="com.arsdigita.packaging.MasterTool" fork="true">
<classpath refid="ccm.classpath" /> <classpath refid="ccm.classpath" />
<sysproperty key="ccm.home" value="${ccm.home}" /> <sysproperty key="ccm.home" value="${ccm.home}" />
<arg line="load ${applications} --parameter-file ${ccm.bundle.folder}/cfg/integration.properties" /> <arg line="load ${applications} --parameter-file ${this.bundle.folder}/cfg/integration.properties" />
</java>
</target>
<target name="load-bundle-interactive" depends="prepare-load">
<echo>Loading bundle ${this.bundle.folder} interactively into ${ccm.home}</echo>
<java classname="com.arsdigita.packaging.MasterTool" fork="true">
<classpath refid="ccm.classpath" />
<sysproperty key="ccm.home" value="${ccm.home}" />
<arg line="load ${applications} --interactive --parameter-file ${this.bundle.folder}/cfg/integration.properties" />
</java> </java>
</target> </target>
<target name="load-bundle-config" depends="prepare-load"> <target name="load-bundle-config" depends="prepare-load">
<echo>load ${applications} --init using ${ccm.bundle.folder}/cfg/integration.properties</echo> <echo>load ${applications} --init using ${this.bundle.folder}/cfg/integration.properties</echo>
<java classname="com.arsdigita.packaging.MasterTool" classpathref="ccm.classpath" fork="yes"> <java classname="com.arsdigita.packaging.MasterTool"
classpathref="ccm.classpath" fork="true">
<sysproperty key="ccm.home" value="${ccm.home}" /> <sysproperty key="ccm.home" value="${ccm.home}" />
<arg line="load ${applications} --config --parameter-file ${ccm.bundle.folder}/cfg/integration.properties" /> <arg line="load ${applications} --config --parameter-file ${this.bundle.folder}/cfg/integration.properties" />
</java>
</target>
<target name="load-bundle-config-interactive" depends="prepare-load">
<echo>load ${applications} --init using ${this.bundle.folder}/cfg/integration.properties</echo>
<java classname="com.arsdigita.packaging.MasterTool"
classpathref="ccm.classpath" fork="true" >
<sysproperty key="ccm.home" value="${ccm.home}" />
<arg line="load ${applications} --config --interactive --parameter-file ${this.bundle.folder}/cfg/integration.properties" />
</java>
</target>
<target name="load-bundle-data" depends="prepare-load">
<echo>load data only executing</echo>
<echo>load --data ${applications}</echo>
<java classname="com.arsdigita.packaging.MasterTool"
classpathref="ccm.classpath" fork="true">
<sysproperty key="ccm.home" value="${ccm.home}" />
<arg line="load --data ${applications}" />
</java> </java>
</target> </target>
<target name="load" depends="prepare-load"> <target name="load" depends="prepare-load">
<echo>load ${applications} </echo> <echo>load ${applications} </echo>
<java classname="com.arsdigita.packaging.MasterTool" classpathref="ccm.classpath" fork="yes"> <java classname="com.arsdigita.packaging.MasterTool"
classpathref="ccm.classpath" fork="true">
<sysproperty key="ccm.home" value="${ccm.home}" /> <sysproperty key="ccm.home" value="${ccm.home}" />
<!-- <!--
<sysproperty key="log4j.configuration" <sysproperty key="log4j.configuration"
@ -43,26 +74,21 @@
</java> </java>
</target> </target>
<target name="load-data" depends="prepare-load">
<echo>load --data ${applications}</echo>
<java classname="com.arsdigita.packaging.MasterTool" classpathref="ccm.classpath" fork="yes">
<sysproperty key="ccm.home" value="${ccm.home}" />
<arg line="load --data ${applications}" />
</java>
</target>
<target name="load-init" depends="prepare-load"> <target name="load-init" depends="prepare-load">
<echo>load --init ${applications}</echo> <echo>load --init ${applications}</echo>
<java classname="com.arsdigita.packaging.MasterTool" classpathref="ccm.classpath" fork="yes"> <java classname="com.arsdigita.packaging.MasterTool"
classpathref="ccm.classpath" fork="true">
<sysproperty key="ccm.home" value="${ccm.home}" /> <sysproperty key="ccm.home" value="${ccm.home}" />
<arg line="load --data ${applications}" /> <arg line="load --data ${applications}" />
</java> </java>
</target> </target>
<target name="prepare-load"> <target name="prepare-load">
<echo>prepare bundle ${ccm.bundle.folder}</echo> <property value="${app.server.webapp.dir}/ROOT/WEB-INF/bin/bundle"
<!-- bundle file applications.cfg replace by project.xml, now part of bundle name="this.bundle.folder" />
<copy file="${ccm.bundle.folder}/cfg/applications.cfg" <echo>prepare bundle ${this.bundle.folder}</echo>
<!-- bundle file applications.cfg replaced by project.xml, now part of bundle
<copy file="${this.bundle.folder}/cfg/applications.cfg"
tofile=".tmp.applications.cfg" overwrite="yes" /> tofile=".tmp.applications.cfg" overwrite="yes" />
<replaceregexp file=".tmp.applications.cfg" match="#.*" replace="" byline="true" /> <replaceregexp file=".tmp.applications.cfg" match="#.*" replace="" byline="true" />
<replaceregexp file=".tmp.applications.cfg" <replaceregexp file=".tmp.applications.cfg"
@ -71,7 +97,7 @@
<java classname="org.apache.xalan.xslt.Process" fork="yes" failonerror="true"> <java classname="org.apache.xalan.xslt.Process" fork="yes" failonerror="true">
<classpath refid="ccm.tools.classpath"/> <classpath refid="ccm.tools.classpath"/>
<arg value="-IN"/> <arg value="-IN"/>
<arg value="${ccm.bundle.folder}/cfg/project.xml"/> <arg value="${this.bundle.folder}/cfg/project.xml"/>
<arg value="-OUT"/> <arg value="-OUT"/>
<arg value=".tmp.applications.list"/> <arg value=".tmp.applications.list"/>
<arg value="-XSL"/> <arg value="-XSL"/>

View File

@ -4,7 +4,7 @@
<!-- build-common <!-- build-common
defines essential system variables and reads configuration property defines essential system variables and reads configuration property
files which configure the specialized scripts. --> files which configure the specialized scripts. -->
<fail message="Property ccm.project.dir not set " <fail message="Property ccm.project.dir not set "
unless="ccm.project.dir" /> unless="ccm.project.dir" />