NIHVIVO-2757 Make solr deploy part of the main build process.
This commit is contained in:
parent
bebc08fb8b
commit
d9ea4c915f
4 changed files with 73 additions and 132 deletions
114
solr/build.xml
114
solr/build.xml
|
@ -1,114 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
|
|
||||||
<!-- $This file is distributed under the terms of the license in /doc/license.txt$ -->
|
|
||||||
|
|
||||||
<!-- ===========================================
|
|
||||||
Deploy script for basic solr webapp for use by a vitro webapp.
|
|
||||||
Vitro should be deployed before this script is run.
|
|
||||||
=========================================== -->
|
|
||||||
|
|
||||||
<project name="vitroSolr" default="describe">
|
|
||||||
<property name="ant.task.dir" location="../utilities/buildutils"/>
|
|
||||||
<property name="solr.build.dir" location="."/>
|
|
||||||
<property name="solr.example.dir" location="${solr.build.dir}/exampleSolr" />
|
|
||||||
<property name="solr.context.config.example" location="${solr.build.dir}/exampleSolrContext.xml"/>
|
|
||||||
<property name="solr.war" location="${solr.build.dir}/apache-solr-3.1.0.war"/>
|
|
||||||
|
|
||||||
<!-- =================================
|
|
||||||
target: describe
|
|
||||||
================================= -->
|
|
||||||
|
|
||||||
<target name="describe" description="--> Describe the targets (this is the default).">
|
|
||||||
<echo>
|
|
||||||
deploy - Deploy solr service for use by vitro.
|
|
||||||
makeSolrjClientJar - Isolate solrj libraries in single jar.
|
|
||||||
</echo>
|
|
||||||
</target>
|
|
||||||
|
|
||||||
<!-- =================================
|
|
||||||
target: deploy
|
|
||||||
================================= -->
|
|
||||||
|
|
||||||
<target name="deploy" depends="properties" description="Deploy solr service for use by vitro.">
|
|
||||||
<property name="solr.home" location="${vitro.home.directory}/solr"/>
|
|
||||||
<property name="solr.docbase" location="${solr.home}/solr.war"/>
|
|
||||||
<property name="solr.context.name" value="${webapp.name}solr"/>
|
|
||||||
<property name="solr.context.config" location="${solr.home}/${solr.context.name}.xml"/>
|
|
||||||
|
|
||||||
<!-- Create and copy the example directory to the solr.home directory. -->
|
|
||||||
<mkdir dir="${solr.home}"/>
|
|
||||||
<copy todir="${solr.home}">
|
|
||||||
<fileset dir="${solr.example.dir}" includes="**/*"/>
|
|
||||||
</copy>
|
|
||||||
|
|
||||||
<!-- Add the war file. -->
|
|
||||||
<copy tofile="${solr.docbase}">
|
|
||||||
<fileset file="${solr.war}"/>
|
|
||||||
</copy>
|
|
||||||
|
|
||||||
<!-- Create the context configuration XML with expanded properties. -->
|
|
||||||
<copy tofile="${solr.context.config}" filtering="true">
|
|
||||||
<fileset file="${solr.context.config.example}"/>
|
|
||||||
<filterchain>
|
|
||||||
<expandproperties />
|
|
||||||
</filterchain>
|
|
||||||
</copy>
|
|
||||||
|
|
||||||
<!-- Place context configuration XML in tomcat config directory. -->
|
|
||||||
<copy todir="${tomcat.home}/conf/Catalina/localhost">
|
|
||||||
<fileset file="${solr.context.config}"/>
|
|
||||||
</copy>
|
|
||||||
|
|
||||||
</target>
|
|
||||||
|
|
||||||
|
|
||||||
<!-- - - - - - - - - - - - - - - - - -
|
|
||||||
target: properties
|
|
||||||
- - - - - - - - - - - - - - - - - -->
|
|
||||||
<target name="properties">
|
|
||||||
<!--<property name="deploy.properties.file" location="deploy.properties" /> -->
|
|
||||||
<fail unless="deploy.properties.file"
|
|
||||||
message="The ant property deploy.properties.file must be defined to indicate the vitro deploy to create a solr service for." />
|
|
||||||
|
|
||||||
<fail message="There is no accessable deploy.properties file at "${deploy.properties.file}".">
|
|
||||||
<condition>
|
|
||||||
<not>
|
|
||||||
<available file="${deploy.properties.file}" />
|
|
||||||
</not>
|
|
||||||
</condition>
|
|
||||||
</fail>
|
|
||||||
|
|
||||||
<property file="${deploy.properties.file}" />
|
|
||||||
|
|
||||||
<fail unless="tomcat.home"
|
|
||||||
message="${deploy.properties.file} must contain a value for tomcat.home" />
|
|
||||||
<fail unless="webapp.name"
|
|
||||||
message="${deploy.properties.file} must contain a value for webapp.name" />
|
|
||||||
<fail unless="vitro.home.directory"
|
|
||||||
message="${deploy.properties.file} must contain a value for vitro.home.directory"/>
|
|
||||||
|
|
||||||
</target>
|
|
||||||
|
|
||||||
<target name="makeSolrjClientJar" >
|
|
||||||
<taskdef name="jarjar" classname="com.tonicsystems.jarjar.JarJarTask"
|
|
||||||
classpath="${ant.task.dir}/jarjar.jar"/>
|
|
||||||
|
|
||||||
<jarjar jarfile="./solrjClient.jar">
|
|
||||||
<zipfileset src="./solrjClientLibs/apache-solr-core-3.1.0.jar"/>
|
|
||||||
<zipfileset src="./solrjClientLibs/apache-solr-solrj-3.1.0.jar"/>
|
|
||||||
<zipfileset src="./solrjClientLibs/commons-codec-1.4.jar"/>
|
|
||||||
<zipfileset src="./solrjClientLibs/commons-httpclient-3.1.jar"/>
|
|
||||||
<zipfileset src="./solrjClientLibs/commons-io-1.4.jar"/>
|
|
||||||
<zipfileset src="./solrjClientLibs/geronimo-stax-api_1.0_spec-1.0.1.jar"/>
|
|
||||||
<zipfileset src="./solrjClientLibs/jcl-over-slf4j-1.5.5.jar"/>
|
|
||||||
<zipfileset src="./solrjClientLibs/wstx-asl-3.2.7.jar"/>
|
|
||||||
|
|
||||||
<!-- leave the slf4j stuff out because it is broken by design -->
|
|
||||||
<rule pattern="org.apache.**" result="isoloated.org.apache.@1"/>
|
|
||||||
<rule pattern="org.codehaus.**" result="isoloated.org.codehaus.@1"/>
|
|
||||||
<rule pattern="com.ctc.**" result="isoloated.com.ctc.@1"/>
|
|
||||||
|
|
||||||
</jarjar>
|
|
||||||
</target>
|
|
||||||
|
|
||||||
</project>
|
|
Binary file not shown.
|
@ -73,13 +73,6 @@ deploy - Deploy the application directly into the Tomcat webapps directory.
|
||||||
================================= -->
|
================================= -->
|
||||||
<target name="all" depends="clean, deploy" description="--> Run 'clean', then 'deploy'" />
|
<target name="all" depends="clean, deploy" description="--> Run 'clean', then 'deploy'" />
|
||||||
|
|
||||||
<!-- =================================
|
|
||||||
target: clean
|
|
||||||
================================= -->
|
|
||||||
<target name="clean" description="--> Delete all artifacts.">
|
|
||||||
<delete dir="${build.dir}" />
|
|
||||||
</target>
|
|
||||||
|
|
||||||
<!-- - - - - - - - - - - - - - - - - -
|
<!-- - - - - - - - - - - - - - - - - -
|
||||||
target: properties
|
target: properties
|
||||||
- - - - - - - - - - - - - - - - - -->
|
- - - - - - - - - - - - - - - - - -->
|
||||||
|
@ -117,6 +110,23 @@ deploy - Deploy the application directly into the Tomcat webapps directory.
|
||||||
<fail unless="rootUser.emailAddress"
|
<fail unless="rootUser.emailAddress"
|
||||||
message="${deploy.properties.file} must contain a value for rootUser.emailAddress" />
|
message="${deploy.properties.file} must contain a value for rootUser.emailAddress" />
|
||||||
|
|
||||||
|
<fail message="The vitro.home.directory "${vitro.home.directory}" does not exist.">
|
||||||
|
<condition>
|
||||||
|
<not>
|
||||||
|
<available file="${vitro.home.directory}" />
|
||||||
|
</not>
|
||||||
|
</condition>
|
||||||
|
</fail>
|
||||||
|
|
||||||
|
<property name="solr.home" location="${vitro.home.directory}/solr" />
|
||||||
|
</target>
|
||||||
|
|
||||||
|
<!-- =================================
|
||||||
|
target: clean
|
||||||
|
================================= -->
|
||||||
|
<target name="clean" depends="properties" description="--> Delete all artifacts.">
|
||||||
|
<delete dir="${build.dir}" />
|
||||||
|
<delete dir="${solr.home}" excludes="data/**/*" includeemptydirs="true" />
|
||||||
</target>
|
</target>
|
||||||
|
|
||||||
<!-- - - - - - - - - - - - - - - - - -
|
<!-- - - - - - - - - - - - - - - - - -
|
||||||
|
@ -253,7 +263,10 @@ deploy - Deploy the application directly into the Tomcat webapps directory.
|
||||||
<!-- =================================
|
<!-- =================================
|
||||||
target: revisionInfo
|
target: revisionInfo
|
||||||
================================= -->
|
================================= -->
|
||||||
<target name="revisionInfo" depends="test" unless="skipinfo" description="--> Store revision info in build">
|
<target name="revisionInfo"
|
||||||
|
depends="test"
|
||||||
|
unless="skipinfo"
|
||||||
|
description="--> Store revision info in build">
|
||||||
<property name="revisionInfo.product.dir" location="${ant.file.vitroCore}/.." />
|
<property name="revisionInfo.product.dir" location="${ant.file.vitroCore}/.." />
|
||||||
<property name="revisionInfo.build.file" location="${war-resources.dir}/revisionInfo.txt" />
|
<property name="revisionInfo.build.file" location="${war-resources.dir}/revisionInfo.txt" />
|
||||||
|
|
||||||
|
@ -285,11 +298,54 @@ deploy - Deploy the application directly into the Tomcat webapps directory.
|
||||||
</java>
|
</java>
|
||||||
</target>
|
</target>
|
||||||
|
|
||||||
|
<!-- - - - - - - - - - - - - - - - - -
|
||||||
|
target: prepareSolr
|
||||||
|
- - - - - - - - - - - - - - - - - -->
|
||||||
|
<target name="prepareSolr" depends="properties">
|
||||||
|
<property name="solr.distrib.dir" location="${webapp.dir}/../solr" />
|
||||||
|
<property name="solr.example.dir" location="${solr.distrib.dir}/exampleSolr" />
|
||||||
|
<property name="solr.context.config.example"
|
||||||
|
location="${solr.distrib.dir}/exampleSolrContext.xml" />
|
||||||
|
<property name="solr.war" location="${solr.distrib.dir}/apache-solr-3.1.0.war" />
|
||||||
|
|
||||||
|
<property name="solr.docbase" location="${solr.home}/solr.war" />
|
||||||
|
<property name="solr.context.name" value="${webapp.name}solr" />
|
||||||
|
<property name="solr.context.config" location="${solr.home}/${solr.context.name}.xml" />
|
||||||
|
|
||||||
|
<!-- Create and copy the example directory to the solr.home directory. -->
|
||||||
|
<mkdir dir="${solr.home}" />
|
||||||
|
<copy todir="${solr.home}">
|
||||||
|
<fileset dir="${solr.example.dir}" includes="**/*" />
|
||||||
|
</copy>
|
||||||
|
|
||||||
|
<!-- Add the war file. -->
|
||||||
|
<copy tofile="${solr.docbase}">
|
||||||
|
<fileset file="${solr.war}" />
|
||||||
|
</copy>
|
||||||
|
|
||||||
|
<!-- Create the context configuration XML with expanded properties. -->
|
||||||
|
<copy tofile="${solr.context.config}" filtering="true">
|
||||||
|
<fileset file="${solr.context.config.example}" />
|
||||||
|
<filterchain>
|
||||||
|
<expandproperties />
|
||||||
|
</filterchain>
|
||||||
|
</copy>
|
||||||
|
</target>
|
||||||
|
|
||||||
|
<!-- - - - - - - - - - - - - - - - - -
|
||||||
|
target: deploySolr
|
||||||
|
- - - - - - - - - - - - - - - - - -->
|
||||||
|
<target name="deploySolr" depends="prepareSolr" unless="noSolrDeploy">
|
||||||
|
<copy todir="${tomcat.home}/conf/Catalina/localhost">
|
||||||
|
<fileset file="${solr.context.config}" />
|
||||||
|
</copy>
|
||||||
|
</target>
|
||||||
|
|
||||||
<!-- =================================
|
<!-- =================================
|
||||||
target: deploy
|
target: deploy
|
||||||
================================= -->
|
================================= -->
|
||||||
<target name="deploy"
|
<target name="deploy"
|
||||||
depends="revisionInfo"
|
depends="revisionInfo, deploySolr"
|
||||||
description="--> Build the app and install in Tomcat">
|
description="--> Build the app and install in Tomcat">
|
||||||
<property name="webapp.deploy.home" value="${tomcat.home}/webapps/${webapp.name}" />
|
<property name="webapp.deploy.home" value="${tomcat.home}/webapps/${webapp.name}" />
|
||||||
|
|
||||||
|
@ -303,10 +359,8 @@ deploy - Deploy the application directly into the Tomcat webapps directory.
|
||||||
<!-- =================================
|
<!-- =================================
|
||||||
target: war
|
target: war
|
||||||
================================= -->
|
================================= -->
|
||||||
<target name="war"
|
<target name="war" depends="revisionInfo" description="--> Build the app and create a WAR file">
|
||||||
depends="revisionInfo"
|
<jar basedir="${build.dir}/war" destfile="${build.dir}/${webapp.name}.war" />
|
||||||
description="--> Build the app and create a WAR file">
|
|
||||||
<jar basedir="${build.dir}/war" destfile="${build.dir}/${webapp.name}.war"/>
|
|
||||||
</target>
|
</target>
|
||||||
|
|
||||||
<!-- =================================
|
<!-- =================================
|
||||||
|
|
|
@ -220,6 +220,7 @@
|
||||||
<target name="deploy" description="--> Build the app and install in Tomcat">
|
<target name="deploy" description="--> Build the app and install in Tomcat">
|
||||||
<!-- the inner "deploy" would just do a sync that will be done by productDeploy -->
|
<!-- the inner "deploy" would just do a sync that will be done by productDeploy -->
|
||||||
<innercall target="revisionInfo" />
|
<innercall target="revisionInfo" />
|
||||||
|
<innercall target="deploySolr" />
|
||||||
<antcall target="productDeploy" />
|
<antcall target="productDeploy" />
|
||||||
</target>
|
</target>
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue