OpenGrok revision 0ca9a2c194523c517c3aafe5758e217ac88d6baa
cd348e325366620fe047edcc849e3c9424828599Peter Bray#!/bin/sh
cd348e325366620fe047edcc849e3c9424828599Peter Bray#
0ca9a2c194523c517c3aafe5758e217ac88d6baaLubos Kosco# OpenGrok Wrapper (initial setup and cron job updating)
0ca9a2c194523c517c3aafe5758e217ac88d6baaLubos Kosco# targeted against OpenSolaris + Debian , tomcat6 and glassfish
cd348e325366620fe047edcc849e3c9424828599Peter Bray#
cd348e325366620fe047edcc849e3c9424828599Peter Bray
0ca9a2c194523c517c3aafe5758e217ac88d6baaLubos Koscoerror() { echo " ERROR: $@" ; }
0ca9a2c194523c517c3aafe5758e217ac88d6baaLubos Koscowarning() { echo "WARNING: $@" ; }
0ca9a2c194523c517c3aafe5758e217ac88d6baaLubos Kosco# `date +%Y-%m-%d-%H-%M`
0ca9a2c194523c517c3aafe5758e217ac88d6baaLubos Kosco
cd348e325366620fe047edcc849e3c9424828599Peter Bray#
cd348e325366620fe047edcc849e3c9424828599Peter Bray# Usage
cd348e325366620fe047edcc849e3c9424828599Peter Bray#
cd348e325366620fe047edcc849e3c9424828599Peter Bray
cd348e325366620fe047edcc849e3c9424828599Peter BrayUsage()
cd348e325366620fe047edcc849e3c9424828599Peter Bray{
cd348e325366620fe047edcc849e3c9424828599Peter Bray echo 1>&2
0ca9a2c194523c517c3aafe5758e217ac88d6baaLubos Kosco echo "Usage: ${0} <deploy|update|updateQuietly|updateConfiguration|usage>" 1>&2
0ca9a2c194523c517c3aafe5758e217ac88d6baaLubos Kosco echo "Optional env variables: "1>&2
0ca9a2c194523c517c3aafe5758e217ac88d6baaLubos Kosco echo "OPENGROK_CONFIGURATION - location of own config, see sample.env.conf" 1>&2
0ca9a2c194523c517c3aafe5758e217ac88d6baaLubos Kosco echo "e.g. $ OPENGROK_CONFIGURATION=/var/opengrok/myog.conf ./${0} ... " 1>&2
cd348e325366620fe047edcc849e3c9424828599Peter Bray echo 1>&2
cd348e325366620fe047edcc849e3c9424828599Peter Bray exit 1
cd348e325366620fe047edcc849e3c9424828599Peter Bray}
cd348e325366620fe047edcc849e3c9424828599Peter Bray
cd348e325366620fe047edcc849e3c9424828599Peter Bray#
cd348e325366620fe047edcc849e3c9424828599Peter Bray# Configuration
cd348e325366620fe047edcc849e3c9424828599Peter Bray#
0ca9a2c194523c517c3aafe5758e217ac88d6baaLubos Kosco
0ca9a2c194523c517c3aafe5758e217ac88d6baaLubos KoscoOS=`/bin/uname`
0ca9a2c194523c517c3aafe5758e217ac88d6baaLubos Kosco
cd348e325366620fe047edcc849e3c9424828599Peter Brayif [ -n "${OPENGROK_CONFIGURATION}" -a -f "${OPENGROK_CONFIGURATION}" ]
cd348e325366620fe047edcc849e3c9424828599Peter Braythen
cd348e325366620fe047edcc849e3c9424828599Peter Bray # Load the Local OpenGrok Configuration Environment
0ca9a2c194523c517c3aafe5758e217ac88d6baaLubos Kosco echo Loading ${OPENGROK_CONFIGURATION} ...
cd348e325366620fe047edcc849e3c9424828599Peter Bray . "${OPENGROK_CONFIGURATION}"
cd348e325366620fe047edcc849e3c9424828599Peter Brayelse
cd348e325366620fe047edcc849e3c9424828599Peter Bray # Use the built-in defaults. This section can be copied to its own
cd348e325366620fe047edcc849e3c9424828599Peter Bray # file and tailored to your local requirements. Then simply set
cd348e325366620fe047edcc849e3c9424828599Peter Bray # OPENGROK_CONFIGURATION=/path/to/your/configuration, before using
cd348e325366620fe047edcc849e3c9424828599Peter Bray # this wrapper. It will save you hand editing in your settings
cd348e325366620fe047edcc849e3c9424828599Peter Bray # on each new release. A sample Cron Entry might look like:
cd348e325366620fe047edcc849e3c9424828599Peter Bray # 15 0 * * * OPENGROK_CONFIGURATION=/pkgs/etc/OpenGrok.sh /pkgs/sbin/OpenGrok updateQuietly
cd348e325366620fe047edcc849e3c9424828599Peter Bray
0ca9a2c194523c517c3aafe5758e217ac88d6baaLubos Kosco # Note: below is doing some small autodetection, use own config in case it fails
0ca9a2c194523c517c3aafe5758e217ac88d6baaLubos Kosco
cd348e325366620fe047edcc849e3c9424828599Peter Bray # Note: It is not really possible to ever provided defaults for
cd348e325366620fe047edcc849e3c9424828599Peter Bray # these values which will run in every UNIX-like environment.
cd348e325366620fe047edcc849e3c9424828599Peter Bray # So I have provided a set which are functional for a given
cd348e325366620fe047edcc849e3c9424828599Peter Bray # environment on which you can based you own configuration.
cd348e325366620fe047edcc849e3c9424828599Peter Bray
0ca9a2c194523c517c3aafe5758e217ac88d6baaLubos Kosco STANDARD_ENV=/pkgs/sbin/CronExecutionEnvironment.sh
0ca9a2c194523c517c3aafe5758e217ac88d6baaLubos Kosco
cd348e325366620fe047edcc849e3c9424828599Peter Bray # Setup a standard execution environment
0ca9a2c194523c517c3aafe5758e217ac88d6baaLubos Kosco if [ -f $STANDARD_ENV ]
cd348e325366620fe047edcc849e3c9424828599Peter Bray then
0ca9a2c194523c517c3aafe5758e217ac88d6baaLubos Kosco echo Loading $STANDARD_ENV ...
0ca9a2c194523c517c3aafe5758e217ac88d6baaLubos Kosco . $STANDARD_ENV
0ca9a2c194523c517c3aafe5758e217ac88d6baaLubos Kosco fi
0ca9a2c194523c517c3aafe5758e217ac88d6baaLubos Kosco
0ca9a2c194523c517c3aafe5758e217ac88d6baaLubos Kosco VARBASE="/var/opengrok"
0ca9a2c194523c517c3aafe5758e217ac88d6baaLubos Kosco
0ca9a2c194523c517c3aafe5758e217ac88d6baaLubos Kosco if [ x"$OS" = x"SunOS" ]; then
0ca9a2c194523c517c3aafe5758e217ac88d6baaLubos Kosco BINARYBASE="/usr/share/lib/java"
0ca9a2c194523c517c3aafe5758e217ac88d6baaLubos Kosco elif [ x"$OS" = x"Linux" ]; then
0ca9a2c194523c517c3aafe5758e217ac88d6baaLubos Kosco BINARYBASE="/usr/share/java"
cd348e325366620fe047edcc849e3c9424828599Peter Bray fi
0ca9a2c194523c517c3aafe5758e217ac88d6baaLubos Kosco # BINARYBASE="./" in case of local execution ...
cd348e325366620fe047edcc849e3c9424828599Peter Bray
cd348e325366620fe047edcc849e3c9424828599Peter Bray # REQUIRED: Source Code/Repository Root
cd348e325366620fe047edcc849e3c9424828599Peter Bray # (your source code or the root of all repositories)
0ca9a2c194523c517c3aafe5758e217ac88d6baaLubos Kosco SRC_ROOT="$VARBASE/src"
cd348e325366620fe047edcc849e3c9424828599Peter Bray
cd348e325366620fe047edcc849e3c9424828599Peter Bray # REQUIRED: OpenGrok Generate Data Root
cd348e325366620fe047edcc849e3c9424828599Peter Bray # (for Lucene index and hypertext cross-references)
cd348e325366620fe047edcc849e3c9424828599Peter Bray # This area is rebuilt by "update" / "updateQuietly"
0ca9a2c194523c517c3aafe5758e217ac88d6baaLubos Kosco DATA_ROOT="$VARBASE/data"
cd348e325366620fe047edcc849e3c9424828599Peter Bray
cd348e325366620fe047edcc849e3c9424828599Peter Bray # OPTIONAL: User Provided Source Path to Description Mapping (Tab Separated Value)
cd348e325366620fe047edcc849e3c9424828599Peter Bray # (The user maintained source of the generated EftarFile file)
0ca9a2c194523c517c3aafe5758e217ac88d6baaLubos Kosco PATH_DESC="$VARBASE/paths.tsv"
cd348e325366620fe047edcc849e3c9424828599Peter Bray
cd348e325366620fe047edcc849e3c9424828599Peter Bray # REQUIRED: XML Configuration
cd348e325366620fe047edcc849e3c9424828599Peter Bray # (the configuration used by Web/GUI interfaces)
0ca9a2c194523c517c3aafe5758e217ac88d6baaLubos Kosco XML_CONFIGURATION="$VARBASE/etc/configuration.xml"
cd348e325366620fe047edcc849e3c9424828599Peter Bray
cd348e325366620fe047edcc849e3c9424828599Peter Bray # REQUIRED: Java Archive of OpenGrok
cd348e325366620fe047edcc849e3c9424828599Peter Bray # (user building from source code will find this other key
cd348e325366620fe047edcc849e3c9424828599Peter Bray # files in the "dist" directory after the build is completed)
0ca9a2c194523c517c3aafe5758e217ac88d6baaLubos Kosco OPENGROK_JAR="$BINARYBASE/opengrok.jar"
cd348e325366620fe047edcc849e3c9424828599Peter Bray
cd348e325366620fe047edcc849e3c9424828599Peter Bray # REQUIRED: Exuberant CTags (http://ctags.sf.net)
0ca9a2c194523c517c3aafe5758e217ac88d6baaLubos Kosco if [ x"$OS" = x"SunOS" ]; then
0ca9a2c194523c517c3aafe5758e217ac88d6baaLubos Kosco EXCTAGS="exctags"
0ca9a2c194523c517c3aafe5758e217ac88d6baaLubos Kosco elif [ x"$OS" = x"Linux" ]; then
0ca9a2c194523c517c3aafe5758e217ac88d6baaLubos Kosco EXCTAGS="ctags-exuberant"
0ca9a2c194523c517c3aafe5758e217ac88d6baaLubos Kosco fi
0ca9a2c194523c517c3aafe5758e217ac88d6baaLubos Kosco EXUBERANT_CTAGS=`which $EXCTAGS`
0ca9a2c194523c517c3aafe5758e217ac88d6baaLubos Kosco # EXUBERANT_CTAGS="/pkgs/64-bit/release/ctags-5.7/bin/ctags"
cd348e325366620fe047edcc849e3c9424828599Peter Bray
cd348e325366620fe047edcc849e3c9424828599Peter Bray # REQUIRED: Java Home
0ca9a2c194523c517c3aafe5758e217ac88d6baaLubos Kosco if [ x"$OS" = x"SunOS" ]; then
0ca9a2c194523c517c3aafe5758e217ac88d6baaLubos Kosco JAVA_HOME="/usr/jdk/instances/jdk1.6.0"
0ca9a2c194523c517c3aafe5758e217ac88d6baaLubos Kosco #JAVA_HOME="/usr/jdk/latest/" # if we will be backwards compatible
0ca9a2c194523c517c3aafe5758e217ac88d6baaLubos Kosco elif [ x"$OS" = x"Linux" ]; then
0ca9a2c194523c517c3aafe5758e217ac88d6baaLubos Kosco JAVA_HOME="/usr/lib/jvm/java-6-sun/bin/"
0ca9a2c194523c517c3aafe5758e217ac88d6baaLubos Kosco fi
cd348e325366620fe047edcc849e3c9424828599Peter Bray export JAVA_HOME
cd348e325366620fe047edcc849e3c9424828599Peter Bray
cd348e325366620fe047edcc849e3c9424828599Peter Bray # REQUIRED: Java Virtual Machine
cd348e325366620fe047edcc849e3c9424828599Peter Bray JAVA="${JAVA_HOME}/bin/java"
cd348e325366620fe047edcc849e3c9424828599Peter Bray
cd348e325366620fe047edcc849e3c9424828599Peter Bray # OPTIONAL: Uncomment the following line if your source contains Mercurial repositories.
cd348e325366620fe047edcc849e3c9424828599Peter Bray SCAN_FOR_REPOSITORY="-S"
cd348e325366620fe047edcc849e3c9424828599Peter Bray
0ca9a2c194523c517c3aafe5758e217ac88d6baaLubos Kosco HG=`which hg`
0ca9a2c194523c517c3aafe5758e217ac88d6baaLubos Kosco CVS=`which cvs`
0ca9a2c194523c517c3aafe5758e217ac88d6baaLubos Kosco SVN=`which svn`
0ca9a2c194523c517c3aafe5758e217ac88d6baaLubos Kosco SCCS=`which sccs`
0ca9a2c194523c517c3aafe5758e217ac88d6baaLubos Kosco
cd348e325366620fe047edcc849e3c9424828599Peter Bray # OPTIONAL: Override Built-in Properties
0ca9a2c194523c517c3aafe5758e217ac88d6baaLubos Kosco PROPERTIES="-Dorg.opensolaris.opengrok.history.Mercurial=$HG \
0ca9a2c194523c517c3aafe5758e217ac88d6baaLubos Kosco-Dorg.opensolaris.opengrok.history.cvs=$CVS \
0ca9a2c194523c517c3aafe5758e217ac88d6baaLubos Kosco-Dorg.opensolaris.opengrok.history.Subversion=$SVN \
0ca9a2c194523c517c3aafe5758e217ac88d6baaLubos Kosco-Dorg.opensolaris.opengrok.history.SCCS=$SCCS"
cd348e325366620fe047edcc849e3c9424828599Peter Bray
cd348e325366620fe047edcc849e3c9424828599Peter Bray # OPTIONAL: JVM Options
cd348e325366620fe047edcc849e3c9424828599Peter Bray #JAVA_OPTS="-server -Xmx1024m"
cd348e325366620fe047edcc849e3c9424828599Peter Bray
0ca9a2c194523c517c3aafe5758e217ac88d6baaLubos Kosco WAR="dist/source.war"
0ca9a2c194523c517c3aafe5758e217ac88d6baaLubos Kosco
cd348e325366620fe047edcc849e3c9424828599Peter Bray # DELIVERED: An update program for EftarFile
cd348e325366620fe047edcc849e3c9424828599Peter Bray # Usage: <class> inputFile [inputFile ...] outputFile
cd348e325366620fe047edcc849e3c9424828599Peter Bray # EftarFile == An Extremely Fast Tagged Attribute Read-only File System
cd348e325366620fe047edcc849e3c9424828599Peter Bray EFTAR_UPDATE="org.opensolaris.opengrok.web.EftarFile"
cd348e325366620fe047edcc849e3c9424828599Peter Bray
cd348e325366620fe047edcc849e3c9424828599Peter Bray # HARDCODED: Generated EftarFile (See web/*.jsp)
cd348e325366620fe047edcc849e3c9424828599Peter Bray EFTAR_OUTPUT_FILE="${DATA_ROOT}/index/dtags.eftar"
cd348e325366620fe047edcc849e3c9424828599Peter Bray
cd348e325366620fe047edcc849e3c9424828599Peter Bray # Be Quiet? (set indirectly by command line arguments in the main program)
cd348e325366620fe047edcc849e3c9424828599Peter Bray QUIET=
cd348e325366620fe047edcc849e3c9424828599Peter Bray
cd348e325366620fe047edcc849e3c9424828599Peter Bray # or alternatively, Be Verbose!
cd348e325366620fe047edcc849e3c9424828599Peter Bray #VERBOSE="-v"
cd348e325366620fe047edcc849e3c9424828599Peter Brayfi
cd348e325366620fe047edcc849e3c9424828599Peter Bray
0ca9a2c194523c517c3aafe5758e217ac88d6baaLubos Koscoif [ ! -x $EXUBERANT_CTAGS ] ; then
0ca9a2c194523c517c3aafe5758e217ac88d6baaLubos Koscoecho "Exuberant ctags for $OS: $EXCTAGS not found or not executable, exiting until this dependency is resolved ..."
0ca9a2c194523c517c3aafe5758e217ac88d6baaLubos Koscoexit 2
0ca9a2c194523c517c3aafe5758e217ac88d6baaLubos Koscofi
0ca9a2c194523c517c3aafe5758e217ac88d6baaLubos Kosco
0ca9a2c194523c517c3aafe5758e217ac88d6baaLubos Koscoif [ ! -d $SRC_ROOT ] ; then
0ca9a2c194523c517c3aafe5758e217ac88d6baaLubos Koscoecho "The source path: $SRC_ROOT doesn't exist, exiting cowardly ..."
0ca9a2c194523c517c3aafe5758e217ac88d6baaLubos Koscoexit 2
0ca9a2c194523c517c3aafe5758e217ac88d6baaLubos Koscofi
0ca9a2c194523c517c3aafe5758e217ac88d6baaLubos Kosco
0ca9a2c194523c517c3aafe5758e217ac88d6baaLubos Koscoif [ ! -d $DATA_ROOT ] ; then
0ca9a2c194523c517c3aafe5758e217ac88d6baaLubos Koscoecho "Index path $DATA_ROOT nonexistent, attempting to create one ... "
0ca9a2c194523c517c3aafe5758e217ac88d6baaLubos Koscomkdir -p $DATA_ROOT
0ca9a2c194523c517c3aafe5758e217ac88d6baaLubos Koscofi
0ca9a2c194523c517c3aafe5758e217ac88d6baaLubos Kosco
cd348e325366620fe047edcc849e3c9424828599Peter Bray#
cd348e325366620fe047edcc849e3c9424828599Peter Bray# Implementation
cd348e325366620fe047edcc849e3c9424828599Peter Bray#
cd348e325366620fe047edcc849e3c9424828599Peter Bray
cd348e325366620fe047edcc849e3c9424828599Peter Bray# The variable "DO" can usefully be set to "echo" to aid in script debugging
cd348e325366620fe047edcc849e3c9424828599Peter Bray
cd348e325366620fe047edcc849e3c9424828599Peter BrayStdInvocation()
cd348e325366620fe047edcc849e3c9424828599Peter Bray{
cd348e325366620fe047edcc849e3c9424828599Peter Bray ${DO} ${JAVA} ${JAVA_OPTS} ${PROPERTIES} \
cd348e325366620fe047edcc849e3c9424828599Peter Bray -jar ${OPENGROK_JAR} \
cd348e325366620fe047edcc849e3c9424828599Peter Bray ${SCAN_FOR_REPOSITORY} ${VERBOSE} ${QUIET} \
cd348e325366620fe047edcc849e3c9424828599Peter Bray ${EXUBERANT_CTAGS:+-c} ${EXUBERANT_CTAGS} \
cd348e325366620fe047edcc849e3c9424828599Peter Bray -s ${SRC_ROOT} -d ${DATA_ROOT} \
cd348e325366620fe047edcc849e3c9424828599Peter Bray "${@}"
cd348e325366620fe047edcc849e3c9424828599Peter Bray}
cd348e325366620fe047edcc849e3c9424828599Peter Bray
cd348e325366620fe047edcc849e3c9424828599Peter BrayUpdateGeneratedConfiguration()
cd348e325366620fe047edcc849e3c9424828599Peter Bray{
cd348e325366620fe047edcc849e3c9424828599Peter Bray StdInvocation -W ${XML_CONFIGURATION}
cd348e325366620fe047edcc849e3c9424828599Peter Bray}
cd348e325366620fe047edcc849e3c9424828599Peter Bray
cd348e325366620fe047edcc849e3c9424828599Peter BrayUpdateGeneratedData()
cd348e325366620fe047edcc849e3c9424828599Peter Bray{
cd348e325366620fe047edcc849e3c9424828599Peter Bray StdInvocation -H
cd348e325366620fe047edcc849e3c9424828599Peter Bray}
cd348e325366620fe047edcc849e3c9424828599Peter Bray
cd348e325366620fe047edcc849e3c9424828599Peter BrayUpdateDescriptionCache()
cd348e325366620fe047edcc849e3c9424828599Peter Bray{
cd348e325366620fe047edcc849e3c9424828599Peter Bray # OPTIONAL : Update the EftarFile data
cd348e325366620fe047edcc849e3c9424828599Peter Bray
cd348e325366620fe047edcc849e3c9424828599Peter Bray if [ -n "${PATH_DESC}" -o -s "${PATH_DESC}" ]
cd348e325366620fe047edcc849e3c9424828599Peter Bray then
cd348e325366620fe047edcc849e3c9424828599Peter Bray ${DO} ${JAVA} -classpath ${OPENGROK_JAR} \
cd348e325366620fe047edcc849e3c9424828599Peter Bray ${EFTAR_UPDATE} ${PATH_DESC} ${EFTAR_OUTPUT_FILE}
cd348e325366620fe047edcc849e3c9424828599Peter Bray fi
cd348e325366620fe047edcc849e3c9424828599Peter Bray}
cd348e325366620fe047edcc849e3c9424828599Peter Bray
cd348e325366620fe047edcc849e3c9424828599Peter BrayOpenGrokUsage()
cd348e325366620fe047edcc849e3c9424828599Peter Bray{
cd348e325366620fe047edcc849e3c9424828599Peter Bray ${DO} ${JAVA} ${JAVA_OPTS} -jar ${OPENGROK_JAR} '-?'
cd348e325366620fe047edcc849e3c9424828599Peter Bray}
cd348e325366620fe047edcc849e3c9424828599Peter Bray
0ca9a2c194523c517c3aafe5758e217ac88d6baaLubos Kosco
0ca9a2c194523c517c3aafe5758e217ac88d6baaLubos Kosco
0ca9a2c194523c517c3aafe5758e217ac88d6baaLubos KoscoDeployWar()
0ca9a2c194523c517c3aafe5758e217ac88d6baaLubos Kosco{
0ca9a2c194523c517c3aafe5758e217ac88d6baaLubos Kosco# detection mechanism could be better, but as a starter this will do the job,
0ca9a2c194523c517c3aafe5758e217ac88d6baaLubos Kosco# if you expect more, write it, we accept patches !
0ca9a2c194523c517c3aafe5758e217ac88d6baaLubos KoscoCONTAINER=""
0ca9a2c194523c517c3aafe5758e217ac88d6baaLubos Kosco
0ca9a2c194523c517c3aafe5758e217ac88d6baaLubos Kosco# tomcat is preffered
0ca9a2c194523c517c3aafe5758e217ac88d6baaLubos Koscoif [ x"$OS" = x"SunOS" ]; then
0ca9a2c194523c517c3aafe5758e217ac88d6baaLubos Kosco WARDIR=/var/tomcat6/webapps/
0ca9a2c194523c517c3aafe5758e217ac88d6baaLubos Koscoelif [ x"$OS" = x"Linux" ]; then
0ca9a2c194523c517c3aafe5758e217ac88d6baaLubos Kosco WARDIR=/var/lib/tomcat6/webapps/
0ca9a2c194523c517c3aafe5758e217ac88d6baaLubos Koscofi
0ca9a2c194523c517c3aafe5758e217ac88d6baaLubos KoscoCONTAINER="tomcat"
0ca9a2c194523c517c3aafe5758e217ac88d6baaLubos Kosco
0ca9a2c194523c517c3aafe5758e217ac88d6baaLubos KoscoDOMAINDIR=/var/appserver/domains
0ca9a2c194523c517c3aafe5758e217ac88d6baaLubos Kosco
0ca9a2c194523c517c3aafe5758e217ac88d6baaLubos Koscoif [ ! -d $WARDIR ]; then
0ca9a2c194523c517c3aafe5758e217ac88d6baaLubos Kosco# test whether glassfish is there, only if tomcat webapp dir is not present
0ca9a2c194523c517c3aafe5758e217ac88d6baaLubos Kosco if [ -x /etc/init.d/appserv ]; then
0ca9a2c194523c517c3aafe5758e217ac88d6baaLubos Kosco if [ -d $DOMAINDIR ]; then
0ca9a2c194523c517c3aafe5758e217ac88d6baaLubos Kosco FIRSTDOMAIN=`ls -1 $DOMAINDIR | head -1`
0ca9a2c194523c517c3aafe5758e217ac88d6baaLubos Kosco WARDIR=$DOMAINDIR/$FIRSTDOMAIN/autodeploy/
0ca9a2c194523c517c3aafe5758e217ac88d6baaLubos Kosco CONTAINER="glassfish"
0ca9a2c194523c517c3aafe5758e217ac88d6baaLubos Kosco else
0ca9a2c194523c517c3aafe5758e217ac88d6baaLubos Kosco error "Glassfish installed, but cannot get first domain from $DOMAINDIR."
0ca9a2c194523c517c3aafe5758e217ac88d6baaLubos Kosco exit 1;
0ca9a2c194523c517c3aafe5758e217ac88d6baaLubos Kosco fi
0ca9a2c194523c517c3aafe5758e217ac88d6baaLubos Kosco else
0ca9a2c194523c517c3aafe5758e217ac88d6baaLubos Kosco error "$WARDIR doesn't exist, seems this combination of application container and $OS is unsupported"
0ca9a2c194523c517c3aafe5758e217ac88d6baaLubos Kosco exit 1;
0ca9a2c194523c517c3aafe5758e217ac88d6baaLubos Kosco fi
0ca9a2c194523c517c3aafe5758e217ac88d6baaLubos Koscofi
0ca9a2c194523c517c3aafe5758e217ac88d6baaLubos Kosco
0ca9a2c194523c517c3aafe5758e217ac88d6baaLubos Kosco
0ca9a2c194523c517c3aafe5758e217ac88d6baaLubos Koscoecho "Copying $WAR to $WARDIR , start your $CONTAINER or wait until it loads the war"
0ca9a2c194523c517c3aafe5758e217ac88d6baaLubos Koscocp $WAR $WARDIR/
0ca9a2c194523c517c3aafe5758e217ac88d6baaLubos KoscoRC=$?
0ca9a2c194523c517c3aafe5758e217ac88d6baaLubos Koscoif [ x$RC=x"0" ]; then
0ca9a2c194523c517c3aafe5758e217ac88d6baaLubos Koscoecho "OpenGrok should be listening on HOST:PORT/source , where HOST and PORT are configured in your $CONTAINER."
0ca9a2c194523c517c3aafe5758e217ac88d6baaLubos Koscoelse
0ca9a2c194523c517c3aafe5758e217ac88d6baaLubos Koscoecho "There was a problem copying the web archive to target directory, consult error message above."
0ca9a2c194523c517c3aafe5758e217ac88d6baaLubos Koscofi
0ca9a2c194523c517c3aafe5758e217ac88d6baaLubos Kosco
0ca9a2c194523c517c3aafe5758e217ac88d6baaLubos Kosco}
0ca9a2c194523c517c3aafe5758e217ac88d6baaLubos Kosco
cd348e325366620fe047edcc849e3c9424828599Peter Bray#
cd348e325366620fe047edcc849e3c9424828599Peter Bray# Main Program
cd348e325366620fe047edcc849e3c9424828599Peter Bray#
cd348e325366620fe047edcc849e3c9424828599Peter Bray
cd348e325366620fe047edcc849e3c9424828599Peter Brayif [ $# -ne 1 ]
cd348e325366620fe047edcc849e3c9424828599Peter Braythen
cd348e325366620fe047edcc849e3c9424828599Peter Bray Usage
cd348e325366620fe047edcc849e3c9424828599Peter Brayfi
cd348e325366620fe047edcc849e3c9424828599Peter Bray
cd348e325366620fe047edcc849e3c9424828599Peter Braycase "${1}" in
cd348e325366620fe047edcc849e3c9424828599Peter Bray
0ca9a2c194523c517c3aafe5758e217ac88d6baaLubos Kosco deploy)
0ca9a2c194523c517c3aafe5758e217ac88d6baaLubos Kosco DeployWar
0ca9a2c194523c517c3aafe5758e217ac88d6baaLubos Kosco ;;
0ca9a2c194523c517c3aafe5758e217ac88d6baaLubos Kosco
cd348e325366620fe047edcc849e3c9424828599Peter Bray update)
cd348e325366620fe047edcc849e3c9424828599Peter Bray UpdateGeneratedData
cd348e325366620fe047edcc849e3c9424828599Peter Bray UpdateDescriptionCache
cd348e325366620fe047edcc849e3c9424828599Peter Bray ;;
cd348e325366620fe047edcc849e3c9424828599Peter Bray
cd348e325366620fe047edcc849e3c9424828599Peter Bray updateQuietly)
cd348e325366620fe047edcc849e3c9424828599Peter Bray QUIET="-q"
cd348e325366620fe047edcc849e3c9424828599Peter Bray VERBOSE=""
cd348e325366620fe047edcc849e3c9424828599Peter Bray UpdateGeneratedData
cd348e325366620fe047edcc849e3c9424828599Peter Bray UpdateDescriptionCache
cd348e325366620fe047edcc849e3c9424828599Peter Bray ;;
cd348e325366620fe047edcc849e3c9424828599Peter Bray
cd348e325366620fe047edcc849e3c9424828599Peter Bray updateConfiguration)
cd348e325366620fe047edcc849e3c9424828599Peter Bray UpdateGeneratedConfiguration
cd348e325366620fe047edcc849e3c9424828599Peter Bray ;;
cd348e325366620fe047edcc849e3c9424828599Peter Bray
cd348e325366620fe047edcc849e3c9424828599Peter Bray usage)
cd348e325366620fe047edcc849e3c9424828599Peter Bray OpenGrokUsage
cd348e325366620fe047edcc849e3c9424828599Peter Bray ;;
cd348e325366620fe047edcc849e3c9424828599Peter Bray
cd348e325366620fe047edcc849e3c9424828599Peter Bray *)
cd348e325366620fe047edcc849e3c9424828599Peter Bray Usage
cd348e325366620fe047edcc849e3c9424828599Peter Bray ;;
cd348e325366620fe047edcc849e3c9424828599Peter Bray
cd348e325366620fe047edcc849e3c9424828599Peter Brayesac
cd348e325366620fe047edcc849e3c9424828599Peter Bray
cd348e325366620fe047edcc849e3c9424828599Peter Bray#
cd348e325366620fe047edcc849e3c9424828599Peter Bray# End of File
cd348e325366620fe047edcc849e3c9424828599Peter Bray#