Reintroduce functionality available via "install_code" target

git-svn-id: http://scm.dspace.org/svn/repo/trunk@1987 9c30dcfa-912a-0410-8fc2-9e0234be79fd
This commit is contained in:
Mark Diggory
2007-05-31 15:57:56 +00:00
parent 2f07826c94
commit f69689a454

View File

@@ -65,7 +65,7 @@ Common usage:
<!-- Will be using various environment variables -->
<!-- ============================================================= -->
<property environment="env"/>
<property environment="env" />
<!-- ============================================================= -->
@@ -88,7 +88,7 @@ Common usage:
<loadproperties srcFile="${config}">
<filterchain>
<linecontainsregexp>
<regexp pattern="^\s*dspace\.dir\s+"/>
<regexp pattern="^\s*dspace\.dir\s+" />
</linecontainsregexp>
</filterchain>
</loadproperties>
@@ -103,9 +103,9 @@ Common usage:
<!-- We will include the environment CLASSPATH -->
<path id="class.path">
<pathelement path="${env.CLASSPATH}"/>
<pathelement path="${env.CLASSPATH}" />
<fileset dir="lib">
<include name="**/*.jar"/>
<include name="**/*.jar" />
</fileset>
</path>
@@ -114,40 +114,101 @@ Common usage:
<!-- Print some useful help text -->
<!-- ============================================================= -->
<target name="help">
<echo message=""/>
<echo message="DSpace configuration file"/>
<echo message="-----------------------------------"/>
<echo message=""/>
<echo message="Available targets are:"/>
<echo message=""/>
<echo message="update --> Update installed code without touching your config or data"/>
<echo message=""/>
<echo message="init_configs --> Write the configuration files to ${dspace.dir}/config"/>
<echo message=""/>
<echo message="fresh_install --> Perform a fresh installation of the software, including the databases &amp; config"/>
<echo message="setup_database --> Create database tables"/>
<echo message="load_registries --> Load metadata &amp; file format registries into the database"/>
<echo message=""/>
<echo message="clean_database --> Remove DSpace database tables, destroying data"/>
<echo message="" />
<echo message="DSpace configuration file" />
<echo message="-----------------------------------" />
<echo message="" />
<echo message="Available targets are:" />
<echo message="" />
<echo message="update --> Update installed code without touching your config or data" />
<echo message="" />
<echo message="init_configs --> Write the configuration files to ${dspace.dir}/config" />
<echo message="install_code --> Install compiled code into ${dspace.dir}" />
<echo message="" />
<echo message="fresh_install --> Perform a fresh installation of the software, including the databases &amp; config" />
<echo message="setup_database --> Create database tables" />
<echo message="load_registries --> Load metadata &amp; file format registries into the database" />
<echo message="" />
<echo message="clean_database --> Remove DSpace database tables, destroying data" />
</target>
<!-- ============================================================= -->
<!-- Update an installation (except database) -->
<!-- ============================================================= -->
<target name="update"
description="Update installed code (without clobbering data/config)">
<target name="update" description="Update installed code (without clobbering data/config)">
<copy todir="${dspace.dir}/config" preservelastmodified="true">
<fileset dir="config/language-packs"/>
<tstamp>
<format property="build.date" pattern="yyyyMMdd-HHmmss" />
</tstamp>
<copy todir="${dspace.dir}/bin" preservelastmodified="true">
<fileset dir="bin" />
</copy>
<chmod dir="${dspace.dir}/bin" perm="u+x" includes="**/*" />
<mkdir dir="${dspace.dir}/lib.bak-${build.date}"/>
<move todir="${dspace.dir}/lib.bak-${build.date}">
<fileset dir="${dspace.dir}/lib">
<include name="**/*"/>
</fileset>
</move>
<copy todir="${dspace.dir}/lib" preservelastmodified="true">
<fileset dir="lib" />
</copy>
<echo>
====================================================================
Copied language packs into ${dspace.dir}/config
${dspace.dir}/lib was backed up to
${dspace.dir}/lib.bak-${build.date}
Please review this directory and delete it if its no longer needed.
====================================================================
</echo>
<mkdir dir="${dspace.dir}/webapps.bak-${build.date}"/>
<move todir="${dspace.dir}/webapps.bak-${build.date}">
<fileset dir="${dspace.dir}/webapps">
<include name="**/*.war"/>
</fileset>
</move>
<copy todir="${dspace.dir}/webapps" preservelastmodified="true">
<fileset dir="webapps" />
</copy>
<echo>
====================================================================
${dspace.dir}/webapps was backed up to
${dspace.dir}/webapps.bak-${build.date}
Please review this directory and delete it if its no longer needed.
====================================================================
</echo>
<copy todir="${dspace.dir}/config" preservelastmodified="true">
<fileset dir="config/language-packs" />
</copy>
<echo>
====================================================================
Copied language packs into ${dspace.dir}/config
====================================================================
Updated Web application (.war) files are in the 'build' directory.
</echo>
<echo>
====================================================================
Updated Web application (.war) files are in the '${dspace.dir}/webapps'
directory.
* Stop your Web servlet container (Tomcat, Jetty, Resin etc.)
@@ -163,6 +224,38 @@ Copied language packs into ${dspace.dir}/config
* Start up your Web servlet container again.
====================================================================
</echo>
</target>
<!-- ============================================================= -->
<!-- Install DSpace and Dependencies -->
<!-- ============================================================= -->
<target name="init_installation">
<mkdir dir="${dspace.dir}/bin" />
<mkdir dir="${dspace.dir}/config" />
<mkdir dir="${dspace.dir}/lib" />
<mkdir dir="${dspace.dir}/webapps" />
<mkdir dir="${assetstore.dir}" />
<mkdir dir="${handle.dir}" />
<mkdir dir="${history.dir}" />
<mkdir dir="${search.dir}" />
<mkdir dir="${log.dir}" />
<mkdir dir="${upload.temp.dir}" />
<mkdir dir="${report.dir}" />
</target>
@@ -174,25 +267,21 @@ Copied language packs into ${dspace.dir}/config
run the install-configs script. The "log4j.build.properties" file is
copied to ${dspace.dir}/config so there's a simple log4j.properties
file present for the initial run of "install-configs". -->
<target name="init_configs">
<target name="init_configs" depends="init_installation">
<copy todir="${dspace.dir}/config" preservelastmodified="true">
<fileset dir="config">
<exclude name="language-packs/**"/>
<exclude name="language-packs/**" />
</fileset>
</copy>
<copy todir="${dspace.dir}/config" preservelastmodified="true">
<fileset dir="config/language-packs"/>
<fileset dir="config/language-packs" />
</copy>
<copy file="etc/log4j.build.properties"
tofile="${dspace.dir}/config/log4j.properties"
preservelastmodified="true"/>
<copy file="etc/log4j.build.properties" tofile="${dspace.dir}/config/log4j.properties" preservelastmodified="true" />
<copy file="${config}"
tofile="${dspace.dir}/config/dspace.cfg"
preservelastmodified="true" />
<copy file="${config}" tofile="${dspace.dir}/config/dspace.cfg" preservelastmodified="true" />
</target>
@@ -204,16 +293,12 @@ Copied language packs into ${dspace.dir}/config
<!-- We execute InitializeDatabase, passing in the simple log4j properties
- file in etc/ and the DSpace configuration file using system
- properties -->
<target name="setup_database"
description="Create database tables">
<target name="setup_database" description="Create database tables">
<java classname="org.dspace.storage.rdbms.InitializeDatabase"
classpathref="class.path"
fork="yes"
failonerror="yes">
<sysproperty key="log4j.configuration" value="file:etc/log4j.build.properties"/>
<sysproperty key="dspace.configuration" value="${config}"/>
<arg value="etc/database_schema.sql"/>
<java classname="org.dspace.storage.rdbms.InitializeDatabase" classpathref="class.path" fork="yes" failonerror="yes">
<sysproperty key="log4j.configuration" value="file:etc/log4j.build.properties" />
<sysproperty key="dspace.configuration" value="${config}" />
<arg value="etc/database_schema.sql" />
</java>
</target>
@@ -226,16 +311,12 @@ Copied language packs into ${dspace.dir}/config
<!-- We execute InitializeDatabase, passing in the simple log4j properties
- file in etc/ and the DSpace configuration file using system
- properties -->
<target name="clean_database"
description="Removes DSpace database tables, destroying data">
<target name="clean_database" description="Removes DSpace database tables, destroying data">
<java classname="org.dspace.storage.rdbms.InitializeDatabase"
classpathref="class.path"
fork="yes"
failonerror="yes">
<sysproperty key="log4j.configuration" value="file:etc/log4j.build.properties"/>
<sysproperty key="dspace.configuration" value="${config}"/>
<arg value="etc/clean-database.sql"/>
<java classname="org.dspace.storage.rdbms.InitializeDatabase" classpathref="class.path" fork="yes" failonerror="yes">
<sysproperty key="log4j.configuration" value="file:etc/log4j.build.properties" />
<sysproperty key="dspace.configuration" value="${config}" />
<arg value="etc/clean-database.sql" />
</java>
</target>
@@ -246,27 +327,20 @@ Copied language packs into ${dspace.dir}/config
<!-- ============================================================= -->
<!-- Loads bitstream format and Dublin Core type registries -->
<target name="load_registries"
description="Load initial contents of registries">
<target name="load_registries" description="Load initial contents of registries">
<java classname="org.dspace.administer.RegistryLoader"
classpathref="class.path"
fork="yes"
failonerror="yes">
<sysproperty key="log4j.configuration" value="file:etc/log4j.build.properties"/>
<sysproperty key="dspace.configuration" value="${config}"/>
<arg value="-bitstream"/>
<arg value="${dspace.dir}/config/registries/bitstream-formats.xml"/>
<java classname="org.dspace.administer.RegistryLoader" classpathref="class.path" fork="yes" failonerror="yes">
<sysproperty key="log4j.configuration" value="file:etc/log4j.build.properties" />
<sysproperty key="dspace.configuration" value="${config}" />
<arg value="-bitstream" />
<arg value="${dspace.dir}/config/registries/bitstream-formats.xml" />
</java>
<java classname="org.dspace.administer.RegistryLoader"
classpathref="class.path"
fork="yes"
failonerror="yes">
<sysproperty key="log4j.configuration" value="file:etc/log4j.build.properties"/>
<sysproperty key="dspace.configuration" value="${config}"/>
<arg value="-dc"/>
<arg value="${dspace.dir}/config/registries/dublin-core-types.xml"/>
<java classname="org.dspace.administer.RegistryLoader" classpathref="class.path" fork="yes" failonerror="yes">
<sysproperty key="log4j.configuration" value="file:etc/log4j.build.properties" />
<sysproperty key="dspace.configuration" value="${config}" />
<arg value="-dc" />
<arg value="${dspace.dir}/config/registries/dublin-core-types.xml" />
</java>
</target>
@@ -276,33 +350,42 @@ Copied language packs into ${dspace.dir}/config
<!-- Do a fresh system install -->
<!-- ============================================================= -->
<target name="fresh_install"
depends="init_configs,setup_database,load_registries"
description="Do a fresh install of the system, overwriting any data">
<target name="fresh_install" depends="init_installation,init_configs,setup_database,load_registries" description="Do a fresh install of the system, overwriting any data">
<java classname="org.dspace.core.ConfigurationManager"
classpathref="class.path"
fork="yes"
failonerror="yes">
<sysproperty key="log4j.configuration" value="file:etc/log4j.build.properties"/>
<sysproperty key="dspace.configuration" value="${config}"/>
<arg value="-installTemplates"/>
<delete dir="${dspace.dir}/bin" includes="**/*" />
<copy todir="${dspace.dir}/bin" preservelastmodified="true">
<fileset dir="bin" />
</copy>
<chmod dir="${dspace.dir}/bin" perm="u+x" includes="**/*" />
<delete dir="${dspace.dir}/lib" includes="**/*" />
<copy todir="${dspace.dir}/lib" preservelastmodified="true">
<fileset dir="lib" />
</copy>
<delete dir="${dspace.dir}/webapps" includes="**/*" />
<copy todir="${dspace.dir}/webapps" preservelastmodified="true">
<fileset dir="webapps" />
</copy>
<java classname="org.dspace.core.ConfigurationManager" classpathref="class.path" fork="yes" failonerror="yes">
<sysproperty key="log4j.configuration" value="file:etc/log4j.build.properties" />
<sysproperty key="dspace.configuration" value="${config}" />
<arg value="-installTemplates" />
</java>
<java classname="org.dspace.browse.InitializeBrowse"
classpathref="class.path"
fork="yes"
failonerror="yes">
<sysproperty key="log4j.configuration" value="file:etc/log4j.build.properties"/>
<sysproperty key="dspace.configuration" value="${config}"/>
<java classname="org.dspace.browse.InitializeBrowse" classpathref="class.path" fork="yes" failonerror="yes">
<sysproperty key="log4j.configuration" value="file:etc/log4j.build.properties" />
<sysproperty key="dspace.configuration" value="${config}" />
</java>
<java classname="org.dspace.search.DSIndexer"
classpathref="class.path"
fork="yes"
failonerror="yes">
<sysproperty key="log4j.configuration" value="file:etc/log4j.build.properties"/>
<sysproperty key="dspace.configuration" value="${config}"/>
<java classname="org.dspace.search.DSIndexer" classpathref="class.path" fork="yes" failonerror="yes">
<sysproperty key="log4j.configuration" value="file:etc/log4j.build.properties" />
<sysproperty key="dspace.configuration" value="${config}" />
</java>
<echo>
@@ -330,6 +413,7 @@ Copied language packs into ${dspace.dir}/config
${dspace.url}/dspace-admin
====================================================================
</echo>
</target>
</project>