OpenGrok revision 5e6c91d7e77062129cd0b6ac8aaa546dff216419
cd348e325366620fe047edcc849e3c9424828599Peter Bray#!/bin/sh
cd348e325366620fe047edcc849e3c9424828599Peter Bray#
0ca9a2c194523c517c3aafe5758e217ac88d6baaLubos Kosco# OpenGrok Wrapper (initial setup and cron job updating)
cd348e325366620fe047edcc849e3c9424828599Peter Bray#
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray# Supported Operating Systems:
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray# - Solaris 10 (SunOS 5.10)
6c8465e3b4611cb632cba9b0572e3e3737c8c341Vladimir Kotal# - OpenSolaris (SunOS 5.11)
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray# - Debian (Linux)
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray#
c577d2f6c082eaff9af5bc997d12f3d3bcef537cPeter Bray# Supported Deployment Engines:
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray# - Tomcat 6
2b024356b830395446c55f50f9f724a63612e578Lubos Kosco# - Tomcat 5.5
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray# - Glassfish
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray#
c577d2f6c082eaff9af5bc997d12f3d3bcef537cPeter Bray# Supported Environment Variables:
c577d2f6c082eaff9af5bc997d12f3d3bcef537cPeter Bray# - OPENGROK_NON_INTERACTIVE Suppress Progress and Warnings Messages (*)
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray# - OPENGROK_STANDARD_ENV Run Time Shell Environment (Shell Script)
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray# - OPENGROK_CONFIGURATION User Configuration (Shell Script)
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray#
c577d2f6c082eaff9af5bc997d12f3d3bcef537cPeter Bray# Supported Environment Variables for configuring the default setup:
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray# - OPENGROK_DISTRIBUTION_BASE Base Directory of the OpenGrok Distribution
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray# - OPENGROK_INSTANCE_BASE Base Directory of the OpenGrok User Data Area
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray# - EXUBERANT_CTAGS Full Path to Exuberant CTags
d961aa46ea0d50fed47802497e45226b1965b12dVladimir Kotal# - JAVA_HOME Full Path to Java Installation Root
d961aa46ea0d50fed47802497e45226b1965b12dVladimir Kotal# - OPENGROK_APP_SERVER Application Server ("Tomcat" or "Glassfish")
d961aa46ea0d50fed47802497e45226b1965b12dVladimir Kotal# - OPENGROK_WAR_TARGET_TOMCAT Tomcat Specific WAR Target Directory
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray# - OPENGROK_WAR_TARGET_GLASSFISH Glassfish Specific WAR Target Directory
cd71fb134e037849c77364b50940b1870c4684ceVladimir Kotal# - OPENGROK_WAR_TARGET Fallback WAR Target Directory
cd71fb134e037849c77364b50940b1870c4684ceVladimir Kotal# - OPENGROK_TOMCAT_BASE Base Directory for Tomcat (contains webapps)
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray# - OPENGROK_GLASSFISH_BASE Base Directory for Glassfish (contains domains)
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray# - OPENGROK_GLASSFISH_DOMAIN Preferred Glassfish Domain Name
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray# - OPENGROK_VERBOSE Enable Verbose Mode in opengrok.jar (*)
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray# - OPENGROK_REMOTE_REPOS Disable History Cache for (remote) Repositories (*)
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray# - OPENGROK_SCAN_REPOS Disable Scan for repositories (*)_
6c8465e3b4611cb632cba9b0572e3e3737c8c341Vladimir Kotal#
6c8465e3b4611cb632cba9b0572e3e3737c8c341Vladimir Kotal# - READ_XML_CONFIGURATION file with read only configuration - a temp workaround for bug # 327
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray#
c577d2f6c082eaff9af5bc997d12f3d3bcef537cPeter Bray# Notes:
6c8465e3b4611cb632cba9b0572e3e3737c8c341Vladimir Kotal# (*) Any Non-Empty String will enable these options
6c8465e3b4611cb632cba9b0572e3e3737c8c341Vladimir Kotal#
6c8465e3b4611cb632cba9b0572e3e3737c8c341Vladimir Kotal
6c8465e3b4611cb632cba9b0572e3e3737c8c341Vladimir Kotal#
b17cb0705d90907337b3528aa7b8ed1700806f26Vladimir Kotal# Usage
6c8465e3b4611cb632cba9b0572e3e3737c8c341Vladimir Kotal#
6c8465e3b4611cb632cba9b0572e3e3737c8c341Vladimir Kotal
6c8465e3b4611cb632cba9b0572e3e3737c8c341Vladimir KotalUsage()
6c8465e3b4611cb632cba9b0572e3e3737c8c341Vladimir Kotal{
6c8465e3b4611cb632cba9b0572e3e3737c8c341Vladimir Kotal echo 1>&2
6c8465e3b4611cb632cba9b0572e3e3737c8c341Vladimir Kotal echo "Usage: ${0} <deploy|update|updateQuietly|usage>" 1>&2
6c8465e3b4611cb632cba9b0572e3e3737c8c341Vladimir Kotal echo " ${0} index [<directory>]" 1>&2
6c8465e3b4611cb632cba9b0572e3e3737c8c341Vladimir Kotal echo 1>&2
6c8465e3b4611cb632cba9b0572e3e3737c8c341Vladimir Kotal echo " Optional environment variables:" 1>&2
6c8465e3b4611cb632cba9b0572e3e3737c8c341Vladimir Kotal echo " OPENGROK_CONFIGURATION - location of your configuration" 1>&2
6c8465e3b4611cb632cba9b0572e3e3737c8c341Vladimir Kotal echo " e.g. $ OPENGROK_CONFIGURATION=/var/opengrok/myog.conf ${0} ... " 1>&2
3ba66fbb56ef22f183da783a1b2718280c357a4eStanislav Kozina echo 1>&2
3ba66fbb56ef22f183da783a1b2718280c357a4eStanislav Kozina echo " See the code for more information on configuration options / variables" 1>&2
6c8465e3b4611cb632cba9b0572e3e3737c8c341Vladimir Kotal echo 1>&2
6c8465e3b4611cb632cba9b0572e3e3737c8c341Vladimir Kotal exit 1
c577d2f6c082eaff9af5bc997d12f3d3bcef537cPeter Bray}
c577d2f6c082eaff9af5bc997d12f3d3bcef537cPeter Bray
c577d2f6c082eaff9af5bc997d12f3d3bcef537cPeter Bray#
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray# Runtime Configuration
0ca9a2c194523c517c3aafe5758e217ac88d6baaLubos Kosco#
6c8465e3b4611cb632cba9b0572e3e3737c8c341Vladimir Kotal
6c8465e3b4611cb632cba9b0572e3e3737c8c341Vladimir KotalOS_NAME="`/bin/uname -s`"
6c8465e3b4611cb632cba9b0572e3e3737c8c341Vladimir KotalOS_VERSION="`/bin/uname -r`"
cd348e325366620fe047edcc849e3c9424828599Peter Bray
3b0448fdd830b8d04c6a71511e5d26a4fc3b5b80Lubos Kosco# TODO: Handle symlinks correctly (especially in ${0})
cd348e325366620fe047edcc849e3c9424828599Peter BraySCRIPT_DIRECTORY="`dirname ${0}`"
cd348e325366620fe047edcc849e3c9424828599Peter BraySCRIPT_DIRECTORY="`cd ${SCRIPT_DIRECTORY}; pwd`"
cd348e325366620fe047edcc849e3c9424828599Peter Bray
6c8465e3b4611cb632cba9b0572e3e3737c8c341Vladimir Kotal#
6c8465e3b4611cb632cba9b0572e3e3737c8c341Vladimir Kotal# Default Instance Configuration
43dac746513591adbd09bc4f417feb385f4fd87eVladimir Kotal#
fbf97ea1786d1e25add88bbfb91810170473bc9fLubos Kosco
fbf97ea1786d1e25add88bbfb91810170473bc9fLubos KoscoDefaultInstanceConfiguration()
fbf97ea1786d1e25add88bbfb91810170473bc9fLubos Kosco{
fbf97ea1786d1e25add88bbfb91810170473bc9fLubos Kosco # Use the built-in defaults. This section can be copied to its own
fbf97ea1786d1e25add88bbfb91810170473bc9fLubos Kosco # file and tailored to your local requirements. Then simply set
fbf97ea1786d1e25add88bbfb91810170473bc9fLubos Kosco # OPENGROK_CONFIGURATION=/path/to/your/configuration, before using
fbf97ea1786d1e25add88bbfb91810170473bc9fLubos Kosco # this wrapper. It will save you hand editing in your settings
fbf97ea1786d1e25add88bbfb91810170473bc9fLubos Kosco # on each new release. A sample cron(1M) entry might look like:
f21b682cd9b414738a4f5a38b56f6682e537e1d2Trond Norbye # 15 0 * * * OPENGROK_CONFIGURATION=/pkgs/etc/OpenGrok.sh /pkgs/sbin/OpenGrok updateQuietly
3b0448fdd830b8d04c6a71511e5d26a4fc3b5b80Lubos Kosco
3b0448fdd830b8d04c6a71511e5d26a4fc3b5b80Lubos Kosco # 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
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray # This has been updated to support more environment variables and
cd348e325366620fe047edcc849e3c9424828599Peter Bray # operating systems, if you have any reasonably generic
2cf31ec93bd5d8a2efeab511ce051da51e69aedaLubos Kosco # improvements please feel free to submit a patch.
2cf31ec93bd5d8a2efeab511ce051da51e69aedaLubos Kosco
43dac746513591adbd09bc4f417feb385f4fd87eVladimir Kotal OPENGROK_INSTANCE_BASE="${OPENGROK_INSTANCE_BASE:-/var/opengrok}"
43dac746513591adbd09bc4f417feb385f4fd87eVladimir Kotal
2cf31ec93bd5d8a2efeab511ce051da51e69aedaLubos Kosco LOGGER_CONFIG_FILE="logging.properties"
43dac746513591adbd09bc4f417feb385f4fd87eVladimir Kotal
43dac746513591adbd09bc4f417feb385f4fd87eVladimir Kotal if [ -z "${OPENGROK_DISTRIBUTION_BASE}" ]
2cf31ec93bd5d8a2efeab511ce051da51e69aedaLubos Kosco then
0ca9a2c194523c517c3aafe5758e217ac88d6baaLubos Kosco if [ -d "${SCRIPT_DIRECTORY}/dist" -a \
d280c5e286f5b98be13237f52281ae5afdcf51b9Peter Bray -f "${SCRIPT_DIRECTORY}/dist/opengrok.jar" -a \
d280c5e286f5b98be13237f52281ae5afdcf51b9Peter Bray -f "${SCRIPT_DIRECTORY}/dist/source.war" \
d280c5e286f5b98be13237f52281ae5afdcf51b9Peter Bray ]
d280c5e286f5b98be13237f52281ae5afdcf51b9Peter Bray then
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray # Handle Developer Build Environments
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray OPENGROK_DISTRIBUTION_BASE="${SCRIPT_DIRECTORY}/dist"
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray LOGGER_CONF_SOURCE="${SCRIPT_DIRECTORY}/${LOGGER_CONFIG_FILE}"
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray else
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray # Handle Binary Distributions
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray OPENGROK_DISTRIBUTION_BASE="${SCRIPT_DIRECTORY}/../lib"
cd348e325366620fe047edcc849e3c9424828599Peter Bray LOGGER_CONF_SOURCE="${OPENGROK_DISTRIBUTION_BASE}/../doc/${LOGGER_CONFIG_FILE}"
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray fi
cd348e325366620fe047edcc849e3c9424828599Peter Bray fi
cd348e325366620fe047edcc849e3c9424828599Peter Bray
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray # REQUIRED: Source Code/Repository Root
cd348e325366620fe047edcc849e3c9424828599Peter Bray # (your source code or the root of all repositories)
cd348e325366620fe047edcc849e3c9424828599Peter Bray SRC_ROOT="${OPENGROK_INSTANCE_BASE}/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"
cd348e325366620fe047edcc849e3c9424828599Peter Bray DATA_ROOT="${OPENGROK_INSTANCE_BASE}/data"
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray # OPTIONAL: User Provided Source Path to Description Mapping (Tab Separated Value)
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray # (The user maintained source of the generated EftarFile file)
0ca9a2c194523c517c3aafe5758e217ac88d6baaLubos Kosco PATH_DESC="${OPENGROK_INSTANCE_BASE}/etc/paths.tsv"
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray
0ca9a2c194523c517c3aafe5758e217ac88d6baaLubos Kosco # REQUIRED: XML Configuration
d280c5e286f5b98be13237f52281ae5afdcf51b9Peter Bray # (the configuration used by Web/GUI interfaces)
5762c9f28c2246777be0e9d49cb29d9c0f49146dLubos Kosco XML_CONFIGURATION="${OPENGROK_INSTANCE_BASE}/etc/configuration.xml"
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray # OPTIONAL: read only XML config, if it exists, it will be read
d280c5e286f5b98be13237f52281ae5afdcf51b9Peter Bray READ_XML_CONFIGURATION="${READ_XML_CONFIGURATION:-}"
d280c5e286f5b98be13237f52281ae5afdcf51b9Peter Bray
d280c5e286f5b98be13237f52281ae5afdcf51b9Peter Bray if [ -f "${READ_XML_CONFIGURATION}" ] ; then
d280c5e286f5b98be13237f52281ae5afdcf51b9Peter Bray READ_XML_CONF="-R ${READ_XML_CONFIGURATION}"
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray fi
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray
d280c5e286f5b98be13237f52281ae5afdcf51b9Peter Bray # REQUIRED: Logger Configuration
b34561d2c3d92fac37dbced05ba6a8738e3d20e9Lubos Kosco LOGGER_CONFIG_PATH="${OPENGROK_INSTANCE_BASE}/${LOGGER_CONFIG_FILE}"
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray LOGGER_PROPERTIES="-Djava.util.logging.config.file=${LOGGER_CONFIG_PATH}"
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray
5e6c91d7e77062129cd0b6ac8aaa546dff216419Lubos Kosco # REQUIRED: Java Archive of OpenGrok (Installation Location)
c83dfde6b364917fa8ed28142d509a7c29a4da68Vladimir Kotal OPENGROK_JAR="${OPENGROK_DISTRIBUTION_BASE}/opengrok.jar"
c83dfde6b364917fa8ed28142d509a7c29a4da68Vladimir Kotal
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray # REQUIRED(deploy): Web Archive of OpenGrok (Distribution Location)
cd348e325366620fe047edcc849e3c9424828599Peter Bray # (user building from source code will find this and other key
cd348e325366620fe047edcc849e3c9424828599Peter Bray # files in the "dist" directory after the build is completed)
cd348e325366620fe047edcc849e3c9424828599Peter Bray OPENGROK_DIST_WAR="${OPENGROK_DISTRIBUTION_BASE}/source.war"
cd348e325366620fe047edcc849e3c9424828599Peter Bray
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray # REQUIRED: Exuberant CTags (http://ctags.sf.net)
cd348e325366620fe047edcc849e3c9424828599Peter Bray EXUBERANT_CTAGS="${EXUBERANT_CTAGS:-`FindExuberantCTags`}"
cd348e325366620fe047edcc849e3c9424828599Peter Bray
cd348e325366620fe047edcc849e3c9424828599Peter Bray # REQUIRED: Java Home
cd348e325366620fe047edcc849e3c9424828599Peter Bray JAVA_HOME="${JAVA_HOME:-`FindJavaHome`}"
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray export JAVA_HOME
cd348e325366620fe047edcc849e3c9424828599Peter Bray
0b2998be561e7bf5e3479d686a5af36f712b0d9aVladimir Kotal # REQUIRED: Java Virtual Machine
0b2998be561e7bf5e3479d686a5af36f712b0d9aVladimir Kotal JAVA="${JAVA:-$JAVA_HOME/bin/java}"
cd348e325366620fe047edcc849e3c9424828599Peter Bray
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray # DEVELOPMENT: Debug option, if enabled current indexer will listen on the port 8010 until a debugger connects
cd348e325366620fe047edcc849e3c9424828599Peter Bray #JAVA_DEBUG="-agentlib:jdwp=transport=dt_socket,server=y,address=8010,suspend=y"
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray
cd348e325366620fe047edcc849e3c9424828599Peter Bray # OPTIONAL: Ignore these patterns as names of files or directories
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray #IGNORE_PATTERNS="-i dummy"
cd348e325366620fe047edcc849e3c9424828599Peter Bray
c842732324ee4c74ede17887ad1f0dcdc4364a2cLubos Kosco # OPTIONAL: Enable Projects
c842732324ee4c74ede17887ad1f0dcdc4364a2cLubos Kosco # (Every directory in SRC_ROOT is considered a separate project)
c842732324ee4c74ede17887ad1f0dcdc4364a2cLubos Kosco ENABLE_PROJECTS="-P"
d7c1415de39f4b07c85828f49cd1ee7a2a19eb9eLubos Kosco
c842732324ee4c74ede17887ad1f0dcdc4364a2cLubos Kosco # OPTIONAL: Scanning Options (for Mercurial repositories)
c842732324ee4c74ede17887ad1f0dcdc4364a2cLubos Kosco SCAN_FOR_REPOSITORY="-S"
c842732324ee4c74ede17887ad1f0dcdc4364a2cLubos Kosco if [ ! -z "${OPENGROK_SCAN_REPOS}" ]
d280c5e286f5b98be13237f52281ae5afdcf51b9Peter Bray then
d280c5e286f5b98be13237f52281ae5afdcf51b9Peter Bray SCAN_FOR_REPOSITORY=""
d280c5e286f5b98be13237f52281ae5afdcf51b9Peter Bray fi
d280c5e286f5b98be13237f52281ae5afdcf51b9Peter Bray
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray # OPTIONAL: Remote Repository Support (CVS or SVN)
3aa0947feb67d3e8292d84776638be98dd97fdc3Lubos Kosco # (Can be very time demanding, uncomment if needed)
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray REMOTE_REPOSITORIES="-r on"
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray if [ ! -z "${OPENGROK_REMOTE_REPOS}" ]
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray then
cd348e325366620fe047edcc849e3c9424828599Peter Bray REMOTE_REPOSITORIES=""
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray fi
cd348e325366620fe047edcc849e3c9424828599Peter Bray
cd348e325366620fe047edcc849e3c9424828599Peter Bray # OPTIONAL: Allow Leading Wildcard Searches
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray # (default: off)
cd348e325366620fe047edcc849e3c9424828599Peter Bray #LEADING_WILDCARD="-a on"
d961aa46ea0d50fed47802497e45226b1965b12dVladimir Kotal
e9dbb478e3339d96ce4f0af5c6ab7e1d35ebb86dVladimir Kotal # OPTIONAL: Web Site Look & Feel
d961aa46ea0d50fed47802497e45226b1965b12dVladimir Kotal # (Options: default, offwhite and polished.
d961aa46ea0d50fed47802497e45226b1965b12dVladimir Kotal # Note the quoting requirements)
d961aa46ea0d50fed47802497e45226b1965b12dVladimir Kotal #SKIN='-L "default"'
d961aa46ea0d50fed47802497e45226b1965b12dVladimir Kotal
d961aa46ea0d50fed47802497e45226b1965b12dVladimir Kotal # OPTIONAL: Set Maximum Indexed Words Per File
cd348e325366620fe047edcc849e3c9424828599Peter Bray # Note, that you might run out of memory, then either increase JVM memory
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray # as noted in JAVA_OPTS, or set this limit(if you don't mind opengrok not
cd348e325366620fe047edcc849e3c9424828599Peter Bray # indexing the rest of the file, once the limit is reached)
cd348e325366620fe047edcc849e3c9424828599Peter Bray # (default: unlimited)
cd348e325366620fe047edcc849e3c9424828599Peter Bray #MAX_INDEXED_WORDS="-m 100000"
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray
cd348e325366620fe047edcc849e3c9424828599Peter Bray # OPTIONAL: Configuration Address (host:port)
56d93b0c761868f813ac0bc0b5bc21a7a9fefd89Vladimir Kotal # (conf/web.xml default is localhost:2424)
56d93b0c761868f813ac0bc0b5bc21a7a9fefd89Vladimir Kotal WEBAPP_CONFIG_ADDRESS="-U localhost:2424"
4f3c0816485669143aa54f1c6461fcb47cf5bc5cVladimir Kotal
4f3c0816485669143aa54f1c6461fcb47cf5bc5cVladimir Kotal # OPTIONAL: JVM Options
2b024356b830395446c55f50f9f724a63612e578Lubos Kosco #JAVA_OPTS="-server -Xmx2048m"
d280c5e286f5b98be13237f52281ae5afdcf51b9Peter Bray JAVA_OPTS="-Xmx2048m"
d280c5e286f5b98be13237f52281ae5afdcf51b9Peter Bray
5762c9f28c2246777be0e9d49cb29d9c0f49146dLubos Kosco # OPTIONAL: Full Path to History Utilities
d280c5e286f5b98be13237f52281ae5afdcf51b9Peter Bray HG="`Which hg`"
d280c5e286f5b98be13237f52281ae5afdcf51b9Peter Bray CVS="`Which cvs`"
d280c5e286f5b98be13237f52281ae5afdcf51b9Peter Bray SVN="`Which svn`"
5762c9f28c2246777be0e9d49cb29d9c0f49146dLubos Kosco SCCS="`Which sccs`"
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray CLEARCASE="`Which cleartool`"
d6ee3934a24d8ccc0e4bb478405d8e5f6a35825dLubos Kosco GIT="`Which git`"
477c09a2656e6a2c1075425ad81e61d594164fa9Lubos Kosco P4="`Which p4`"
c842732324ee4c74ede17887ad1f0dcdc4364a2cLubos Kosco MTN="`Which mtn`"
d6ee3934a24d8ccc0e4bb478405d8e5f6a35825dLubos Kosco BZR="`Which bzr`"
c842732324ee4c74ede17887ad1f0dcdc4364a2cLubos Kosco
cd348e325366620fe047edcc849e3c9424828599Peter Bray # OPTIONAL: Override Built-in Properties
b17cb0705d90907337b3528aa7b8ed1700806f26Vladimir Kotal # Assumption: We should not set properties to the empty string
d6ee3934a24d8ccc0e4bb478405d8e5f6a35825dLubos Kosco PROPERTIES="\
b17cb0705d90907337b3528aa7b8ed1700806f26Vladimir Kotal${HG:+-Dorg.opensolaris.opengrok.history.Mercurial=$HG} \
8f8c3f4555e5aa3160f03f2e9c55ddbd3381357bLubos Kosco${CVS:+-Dorg.opensolaris.opengrok.history.cvs=$CVS} \
d6ee3934a24d8ccc0e4bb478405d8e5f6a35825dLubos Kosco${SVN:+-Dorg.opensolaris.opengrok.history.Subversion=$SVN} \
8f8c3f4555e5aa3160f03f2e9c55ddbd3381357bLubos Kosco${SCCS:+-Dorg.opensolaris.opengrok.history.SCCS=$SCCS} \
d280c5e286f5b98be13237f52281ae5afdcf51b9Peter Bray${CLEARCASE:+-Dorg.opensolaris.opengrok.history.ClearCase=$CLEARCASE} \
d70dc22c6dce3f498251b0873638d1fea0e644a3Lubos Kosco${GIT:+-Dorg.opensolaris.opengrok.history.git=$GIT} \
477c09a2656e6a2c1075425ad81e61d594164fa9Lubos Kosco${P4:+-Dorg.opensolaris.opengrok.history.Perforce=$P4} \
d70dc22c6dce3f498251b0873638d1fea0e644a3Lubos Kosco${MTN:+-Dorg.opensolaris.opengrok.history.Monotone=$MTN} \
d70dc22c6dce3f498251b0873638d1fea0e644a3Lubos Kosco${BZR:+-Dorg.opensolaris.opengrok.history.Bazaar=$BZR} \
d70dc22c6dce3f498251b0873638d1fea0e644a3Lubos Kosco"
d70dc22c6dce3f498251b0873638d1fea0e644a3Lubos Kosco
d280c5e286f5b98be13237f52281ae5afdcf51b9Peter Bray # OPTIONAL: Store The History Cache in Java DB (derby),
2cf31ec93bd5d8a2efeab511ce051da51e69aedaLubos Kosco # instead of file system (in gzipped xml files).
2cf31ec93bd5d8a2efeab511ce051da51e69aedaLubos Kosco #
2cf31ec93bd5d8a2efeab511ce051da51e69aedaLubos Kosco # Requirements:
2cf31ec93bd5d8a2efeab511ce051da51e69aedaLubos Kosco # - derbyclient.jar - See README.txt for more details
2cf31ec93bd5d8a2efeab511ce051da51e69aedaLubos Kosco # - Running Derby Server - Defaults to localhost:1527
2cf31ec93bd5d8a2efeab511ce051da51e69aedaLubos Kosco #
d280c5e286f5b98be13237f52281ae5afdcf51b9Peter Bray #DERBY_HISTORY_CACHE=-D
d280c5e286f5b98be13237f52281ae5afdcf51b9Peter Bray
d280c5e286f5b98be13237f52281ae5afdcf51b9Peter Bray # DELIVERED: An update program for EftarFile
d280c5e286f5b98be13237f52281ae5afdcf51b9Peter Bray # Usage: <class> inputFile [inputFile ...] outputFile
1a5c2ab40bd94d2b2c63afda767ce7bbf29ecc4bJan Friedel # EftarFile == An Extremely Fast Tagged Attribute Read-only File System
5762c9f28c2246777be0e9d49cb29d9c0f49146dLubos Kosco EFTAR_UPDATE="org.opensolaris.opengrok.web.EftarFile"
e87f836e908f8279021f79c8f7bcef98e99d126eLubos Kosco
e87f836e908f8279021f79c8f7bcef98e99d126eLubos Kosco # HARDCODED: Generated EftarFile (See web/*.jsp)
e87f836e908f8279021f79c8f7bcef98e99d126eLubos Kosco EFTAR_OUTPUT_FILE="${DATA_ROOT}/index/dtags.eftar"
e87f836e908f8279021f79c8f7bcef98e99d126eLubos Kosco
e87f836e908f8279021f79c8f7bcef98e99d126eLubos Kosco # Be Quiet? (set indirectly by command line arguments in the main program)
d280c5e286f5b98be13237f52281ae5afdcf51b9Peter Bray #QUIET=""
5762c9f28c2246777be0e9d49cb29d9c0f49146dLubos Kosco
d280c5e286f5b98be13237f52281ae5afdcf51b9Peter Bray # or alternatively, Be Verbose!
d280c5e286f5b98be13237f52281ae5afdcf51b9Peter Bray #VERBOSE="-v"
6c8465e3b4611cb632cba9b0572e3e3737c8c341Vladimir Kotal
6c8465e3b4611cb632cba9b0572e3e3737c8c341Vladimir Kotal if [ ! -z "${OPENGROK_VERBOSE}" ]
6c8465e3b4611cb632cba9b0572e3e3737c8c341Vladimir Kotal then
6c8465e3b4611cb632cba9b0572e3e3737c8c341Vladimir Kotal VERBOSE="-v"
6c8465e3b4611cb632cba9b0572e3e3737c8c341Vladimir Kotal QUIET=""
6c8465e3b4611cb632cba9b0572e3e3737c8c341Vladimir Kotal fi
6c8465e3b4611cb632cba9b0572e3e3737c8c341Vladimir Kotal}
6c8465e3b4611cb632cba9b0572e3e3737c8c341Vladimir Kotal
6c8465e3b4611cb632cba9b0572e3e3737c8c341Vladimir Kotal#
6c8465e3b4611cb632cba9b0572e3e3737c8c341Vladimir Kotal# Helper Functions - Logging
6c8465e3b4611cb632cba9b0572e3e3737c8c341Vladimir Kotal#
6c8465e3b4611cb632cba9b0572e3e3737c8c341Vladimir Kotal# In general, non-interactive use like cron jobs and automated
6c8465e3b4611cb632cba9b0572e3e3737c8c341Vladimir Kotal# installation environments should not generate unnecessary
d280c5e286f5b98be13237f52281ae5afdcf51b9Peter Bray# progress information or warnings, as usage and configuration
d280c5e286f5b98be13237f52281ae5afdcf51b9Peter Bray# will have generally been debugged prior to automation.
cd71fb134e037849c77364b50940b1870c4684ceVladimir Kotal#
5762c9f28c2246777be0e9d49cb29d9c0f49146dLubos Kosco
d2a02e104622a26dd90fa88f4f17188f2039809fPeter BrayProgress()
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray{
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray if [ -z "${OPENGROK_NON_INTERACTIVE}" ]
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray then
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray echo "${@}"
2b024356b830395446c55f50f9f724a63612e578Lubos Kosco fi
2b024356b830395446c55f50f9f724a63612e578Lubos Kosco}
2b024356b830395446c55f50f9f724a63612e578Lubos Kosco
2b024356b830395446c55f50f9f724a63612e578Lubos KoscoWarning()
2b024356b830395446c55f50f9f724a63612e578Lubos Kosco{
0ca9a2c194523c517c3aafe5758e217ac88d6baaLubos Kosco if [ -z "${OPENGROK_NON_INTERACTIVE}" ]
cd348e325366620fe047edcc849e3c9424828599Peter Bray then
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray echo "WARNING: ${@}" 1>&2
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray fi
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray}
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray
d2a02e104622a26dd90fa88f4f17188f2039809fPeter BrayError()
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray{
2b024356b830395446c55f50f9f724a63612e578Lubos Kosco echo "ERROR: ${@}" 1>&2
2b024356b830395446c55f50f9f724a63612e578Lubos Kosco}
2b024356b830395446c55f50f9f724a63612e578Lubos Kosco
2b024356b830395446c55f50f9f724a63612e578Lubos KoscoFatalError()
2b024356b830395446c55f50f9f724a63612e578Lubos Kosco{
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray echo 1>&2
cd348e325366620fe047edcc849e3c9424828599Peter Bray echo "FATAL ERROR: ${@} - Aborting!" 1>&2
d280c5e286f5b98be13237f52281ae5afdcf51b9Peter Bray echo 1>&2
d280c5e286f5b98be13237f52281ae5afdcf51b9Peter Bray ${DO} exit 2
4e854c69a0484765dcd27b0e837898c8b6969beaTrond Norbye}
d280c5e286f5b98be13237f52281ae5afdcf51b9Peter Bray
d280c5e286f5b98be13237f52281ae5afdcf51b9Peter Bray#
d280c5e286f5b98be13237f52281ae5afdcf51b9Peter Bray# Helper Functions - Autodetection of Runtime Environment
d280c5e286f5b98be13237f52281ae5afdcf51b9Peter Bray#
477c09a2656e6a2c1075425ad81e61d594164fa9Lubos Kosco
477c09a2656e6a2c1075425ad81e61d594164fa9Lubos KoscoWhich()
477c09a2656e6a2c1075425ad81e61d594164fa9Lubos Kosco{
477c09a2656e6a2c1075425ad81e61d594164fa9Lubos Kosco path="`which ${1} 2>/dev/null`"
cd348e325366620fe047edcc849e3c9424828599Peter Bray
3ba66fbb56ef22f183da783a1b2718280c357a4eStanislav Kozina if [ -x "${path}" ]
3ba66fbb56ef22f183da783a1b2718280c357a4eStanislav Kozina then
3ba66fbb56ef22f183da783a1b2718280c357a4eStanislav Kozina echo "${path}"
3ba66fbb56ef22f183da783a1b2718280c357a4eStanislav Kozina fi
3ba66fbb56ef22f183da783a1b2718280c357a4eStanislav Kozina}
3ba66fbb56ef22f183da783a1b2718280c357a4eStanislav Kozina
3ba66fbb56ef22f183da783a1b2718280c357a4eStanislav KozinaFindExuberantCTags()
3ba66fbb56ef22f183da783a1b2718280c357a4eStanislav Kozina{
cd348e325366620fe047edcc849e3c9424828599Peter Bray case "${OS_NAME}:${OS_VERSION}" in
cd348e325366620fe047edcc849e3c9424828599Peter Bray SunOS:5.10) commandName="" ;;
cd348e325366620fe047edcc849e3c9424828599Peter Bray SunOS:5.11) commandName="exctags" ;;
cd348e325366620fe047edcc849e3c9424828599Peter Bray Linux:*) commandName="ctags-exuberant" ;;
cd348e325366620fe047edcc849e3c9424828599Peter Bray *) commandName="" ;;
cd348e325366620fe047edcc849e3c9424828599Peter Bray esac
cd348e325366620fe047edcc849e3c9424828599Peter Bray
cd348e325366620fe047edcc849e3c9424828599Peter Bray if [ -z "${commandName}" ]
cd348e325366620fe047edcc849e3c9424828599Peter Bray then
d280c5e286f5b98be13237f52281ae5afdcf51b9Peter Bray Error "Unable to determine Exuberant CTags command name" \
cd348e325366620fe047edcc849e3c9424828599Peter Bray "for ${OS_NAME} ${OS_VERSION}"
cd348e325366620fe047edcc849e3c9424828599Peter Bray return
d280c5e286f5b98be13237f52281ae5afdcf51b9Peter Bray fi
c577d2f6c082eaff9af5bc997d12f3d3bcef537cPeter Bray
477c09a2656e6a2c1075425ad81e61d594164fa9Lubos Kosco Which "${commandName}"
4e854c69a0484765dcd27b0e837898c8b6969beaTrond Norbye}
c577d2f6c082eaff9af5bc997d12f3d3bcef537cPeter Bray
c577d2f6c082eaff9af5bc997d12f3d3bcef537cPeter BrayFindJavaHome()
8f8c3f4555e5aa3160f03f2e9c55ddbd3381357bLubos Kosco{
d0767114e1a949e4a42358f5aeaa08590b87cd80Trond Norbye case "${OS_NAME}:${OS_VERSION}" in
3a5046f0538ba9fb3a9429199544a9f4b93d9a4dLubos Kosco SunOS:5.10) javaHome="/usr/jdk/instances/jdk1.6.0" ;;
3a5046f0538ba9fb3a9429199544a9f4b93d9a4dLubos Kosco SunOS:5.11) javaHome="/usr/jdk/latest" ;;
3a5046f0538ba9fb3a9429199544a9f4b93d9a4dLubos Kosco Linux:*) javaHome="/usr/lib/jvm/java-6-sun" ;;
3a5046f0538ba9fb3a9429199544a9f4b93d9a4dLubos Kosco *) javaHome="" ;;
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray esac
cd348e325366620fe047edcc849e3c9424828599Peter Bray
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray if [ -z "${javaHome}" ]
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray then
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray Error "Unable to determine Java 6 Home" \
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray "for ${OS_NAME} ${OS_VERSION}"
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray return
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray fi
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray if [ ! -d "${javaHome}" ]
0ca9a2c194523c517c3aafe5758e217ac88d6baaLubos Kosco then
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray Error "Missing Java Home ${javaHome}"
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray return
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray fi
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray echo "${javaHome}"
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray}
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray
0ca9a2c194523c517c3aafe5758e217ac88d6baaLubos KoscoFindApplicationServerType()
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray{
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray # Use this function to determine which environment the deploy the
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray # web application function into. Some users (especially
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray # developers) will have many deployment environments or will wish
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray # to specify directly the application server to deploy to.
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray # Either use the environment variable OPENGROK_APP_SERVER or
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray # reimplement this function in your configuration file (as
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray # specified by OPENGROK_CONFIGURATION)
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray if [ -n "${OPENGROK_APP_SERVER}" ]
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray then
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray echo "${OPENGROK_APP_SERVER}"
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray return
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray fi
c83dfde6b364917fa8ed28142d509a7c29a4da68Vladimir Kotal
c83dfde6b364917fa8ed28142d509a7c29a4da68Vladimir Kotal # This implementation favours Tomcat, but needs a lot of work,
c83dfde6b364917fa8ed28142d509a7c29a4da68Vladimir Kotal # especially if Glassfish is perferrerd or it is under the control
c83dfde6b364917fa8ed28142d509a7c29a4da68Vladimir Kotal # of SMF (Service Management Facility)
c83dfde6b364917fa8ed28142d509a7c29a4da68Vladimir Kotal
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray # Maybe a better implementation would be to call Application
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray # Server specific WAR Directory and see if they exist.
0ca9a2c194523c517c3aafe5758e217ac88d6baaLubos Kosco
cd348e325366620fe047edcc849e3c9424828599Peter Bray if [ -d "/var/tomcat6/webapps" \
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray -o -d "/var/lib/tomcat6/webapps" \
cd348e325366620fe047edcc849e3c9424828599Peter Bray -o -d "/var/lib/tomcat5.5/webapps" \
cd348e325366620fe047edcc849e3c9424828599Peter Bray ]
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray then
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray echo "Tomcat"
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray return
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray fi
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray if [ -x "/etc/init.d/appserv" -a -d "/var/appserver/domains" ]
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray then
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray echo "Glassfish"
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray return
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray fi
d0767114e1a949e4a42358f5aeaa08590b87cd80Trond Norbye
d0767114e1a949e4a42358f5aeaa08590b87cd80Trond Norbye # Assume Tomcat
d0767114e1a949e4a42358f5aeaa08590b87cd80Trond Norbye echo "Tomcat"
56d93b0c761868f813ac0bc0b5bc21a7a9fefd89Vladimir Kotal}
d0767114e1a949e4a42358f5aeaa08590b87cd80Trond Norbye
d0767114e1a949e4a42358f5aeaa08590b87cd80Trond NorbyeDetermineWarDirectoryTomcat()
d0767114e1a949e4a42358f5aeaa08590b87cd80Trond Norbye{
d0767114e1a949e4a42358f5aeaa08590b87cd80Trond Norbye if [ -n "${OPENGROK_WAR_TARGET_TOMCAT}" ]
d0767114e1a949e4a42358f5aeaa08590b87cd80Trond Norbye then
d0767114e1a949e4a42358f5aeaa08590b87cd80Trond Norbye echo "${OPENGROK_WAR_TARGET_TOMCAT}"
d0767114e1a949e4a42358f5aeaa08590b87cd80Trond Norbye return
d0767114e1a949e4a42358f5aeaa08590b87cd80Trond Norbye elif [ -n "${OPENGROK_WAR_TARGET}" ]
d0767114e1a949e4a42358f5aeaa08590b87cd80Trond Norbye then
d0767114e1a949e4a42358f5aeaa08590b87cd80Trond Norbye echo "${OPENGROK_WAR_TARGET}"
d0767114e1a949e4a42358f5aeaa08590b87cd80Trond Norbye return
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray fi
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray
d0767114e1a949e4a42358f5aeaa08590b87cd80Trond Norbye for prefix in \
d0767114e1a949e4a42358f5aeaa08590b87cd80Trond Norbye ${OPENGROK_TOMCAT_BASE} \
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray /var/tomcat6 \
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray /var/lib/tomcat6 \
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray /var/lib/tomcat5.5 \
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray do
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray if [ -d "${prefix}/webapps" ]
d0767114e1a949e4a42358f5aeaa08590b87cd80Trond Norbye then
d0767114e1a949e4a42358f5aeaa08590b87cd80Trond Norbye echo "${prefix}/webapps"
d0767114e1a949e4a42358f5aeaa08590b87cd80Trond Norbye return
d0767114e1a949e4a42358f5aeaa08590b87cd80Trond Norbye fi
d0767114e1a949e4a42358f5aeaa08590b87cd80Trond Norbye done
d0767114e1a949e4a42358f5aeaa08590b87cd80Trond Norbye}
d0767114e1a949e4a42358f5aeaa08590b87cd80Trond Norbye
d0767114e1a949e4a42358f5aeaa08590b87cd80Trond NorbyeDetermineWarDirectoryGlassfish()
d0767114e1a949e4a42358f5aeaa08590b87cd80Trond Norbye{
d0767114e1a949e4a42358f5aeaa08590b87cd80Trond Norbye
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray if [ -n "${OPENGROK_WAR_TARGET_GLASSFISH}" ]
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray then
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray echo "${OPENGROK_WAR_TARGET_GLASSFISH}"
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray return
4e854c69a0484765dcd27b0e837898c8b6969beaTrond Norbye elif [ -n "${OPENGROK_WAR_TARGET}" ]
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray then
a3a5f5c0500064f4c6ac3658b1e3e4d838912329Lubos Kosco echo "${OPENGROK_WAR_TARGET}"
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray return
4e854c69a0484765dcd27b0e837898c8b6969beaTrond Norbye fi
4e854c69a0484765dcd27b0e837898c8b6969beaTrond Norbye
4e854c69a0484765dcd27b0e837898c8b6969beaTrond Norbye for prefix in \
4e854c69a0484765dcd27b0e837898c8b6969beaTrond Norbye ${OPENGROK_GLASSFISH_BASE} \
4e854c69a0484765dcd27b0e837898c8b6969beaTrond Norbye /var/appserver \
4e854c69a0484765dcd27b0e837898c8b6969beaTrond Norbye
4e854c69a0484765dcd27b0e837898c8b6969beaTrond Norbye do
4e854c69a0484765dcd27b0e837898c8b6969beaTrond Norbye if [ -d "${prefix}/domains" ]
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray then
4e854c69a0484765dcd27b0e837898c8b6969beaTrond Norbye if [ -z "${domainDirectory}" ]
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray then
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray domainDirectory="${prefix}/domains"
a3a5f5c0500064f4c6ac3658b1e3e4d838912329Lubos Kosco fi
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray fi
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray done
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray if [ -z "${domainDirectory}" ]
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray then
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray return
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray fi
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray # User Specified Domain
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray if [ -n "${OPENGROK_GLASSFISH_DOMAIN}" ]
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray then
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray directory="${domainDirectory}/${OPENGROK_GLASSFISH_DOMAIN}/autodeploy"
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray if [ ! -d "${directory}" ]
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray then
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray FatalError "Missing Specified Glassfish Domain ${OPENGROK_GLASSFISH_DOMAIN}"
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray fi
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray echo "${directory}"
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray return
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray fi
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray # Arbitrary Domain Selection
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray firstDomain=`ls -1 ${domainDirectory} | head -1`
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray if [ -z "${firstDomain}" ]
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray then
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray FatalError "Failed to dynamically determine Glassfish Domain from ${domainDirectory}"
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray fi
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray echo "${domainDirectory}/${firstDomain}/autodeploy"
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray}
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray#
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray# Implementation
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray#
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray# The variable "DO" can usefully be set to "echo" to aid in script debugging
340e2c0d70fade14c720931c87652727b941c167Vladimir Kotal#
340e2c0d70fade14c720931c87652727b941c167Vladimir Kotal
340e2c0d70fade14c720931c87652727b941c167Vladimir KotalLoadStandardEnvironment()
340e2c0d70fade14c720931c87652727b941c167Vladimir Kotal{
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray # Setup a standard execution environment (if required)
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray OPENGROK_STANDARD_ENV="${OPENGROK_STANDARD_ENV:-/pkgs/sbin/CronExecutionEnvironment.sh}"
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray if [ -f "${OPENGROK_STANDARD_ENV}" ]
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray then
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray Progress "Loading ${OPENGROK_STANDARD_ENV} ..."
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray . "${OPENGROK_STANDARD_ENV}"
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray fi
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray}
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray
d2a02e104622a26dd90fa88f4f17188f2039809fPeter BrayLoadInstanceConfiguration()
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray{
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray # Note: As all functions have been defined by the time this routine
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray # is called, your configuration can, if desired, override functions
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray # in addition to setting the variables mentioned in the function
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray # DefaultInstanceConfiguration(), this maybe useful to override
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray # functionality used to determine the default deployment environment
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray # find dependencies or validate the configuration, for example.
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray if [ -n "${OPENGROK_CONFIGURATION}" -a -f "${OPENGROK_CONFIGURATION}" ]
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray then
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray # Load the Local OpenGrok Configuration Environment
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray Progress "Loading ${OPENGROK_CONFIGURATION} ..."
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray . "${OPENGROK_CONFIGURATION}"
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray else
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray Progress "Loading the default instance configuration ..."
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray DefaultInstanceConfiguration
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray fi
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray}
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray
d2a02e104622a26dd90fa88f4f17188f2039809fPeter BrayValidateConfiguration()
d0767114e1a949e4a42358f5aeaa08590b87cd80Trond Norbye{
340e2c0d70fade14c720931c87652727b941c167Vladimir Kotal if [ ! -x "${EXUBERANT_CTAGS}" ]
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray then
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray FatalError "Missing Dependent Application - Exuberant CTags"
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray fi
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray if [ ! -d "${SRC_ROOT}" ]
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray then
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray FatalError "OpenGrok Source Path ${SRC_ROOT} doesn't exist"
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray fi
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray if [ -n "${QUIET}" -a -n "${VERBOSE}" ]
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray then
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray Warning "Both Quiet and Verbose Mode Enabled - Choosing Verbose"
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray QUIET=""
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray VERBOSE="-v"
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray fi
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray}
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray
d2a02e104622a26dd90fa88f4f17188f2039809fPeter BrayCreateRuntimeRequirements()
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray{
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray if [ ! -d "${DATA_ROOT}" ]
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray then
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray Warning "OpenGrok Generated Data Path ${DATA_ROOT} doesn't exist"
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray Progress " Attempting to create generated data directory ... "
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray ${DO} mkdir -p "${DATA_ROOT}"
340e2c0d70fade14c720931c87652727b941c167Vladimir Kotal fi
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray if [ ! -d "${DATA_ROOT}" ]
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray then
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray FatalError "OpenGrok Data Path ${DATA_ROOT} doesn't exist"
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray fi
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray if [ ! -d "${OPENGROK_INSTANCE_BASE}/etc" ]
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray then
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray Warning "OpenGrok Generated Etc Path ${OPENGROK_INSTANCE_BASE}/etc doesn't exist"
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray Progress " Attempting to create generated etc directory ... "
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray ${DO} mkdir -p "${OPENGROK_INSTANCE_BASE}/etc"
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray fi
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray if [ ! -d "${OPENGROK_INSTANCE_BASE}/etc" ]
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray then
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray FatalError "OpenGrok Etc Path ${OPENGROK_INSTANCE_BASE}/etc doesn't exist"
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray fi
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray if [ -n "${LOGGER_CONFIG_PATH}" -a ! -f "${LOGGER_CONFIG_PATH}" ]
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray then
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray Progress " Creating default ${LOGGER_CONFIG_PATH} ... "
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray if [ ! -f "${LOGGER_CONF_SOURCE}" ]
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray then
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray Warning "Can't find distribution logging configuration" \
56d93b0c761868f813ac0bc0b5bc21a7a9fefd89Vladimir Kotal "(${LOGGER_CONF_SOURCE}) to install as default" \
56d93b0c761868f813ac0bc0b5bc21a7a9fefd89Vladimir Kotal "logging configuration (${LOGGER_CONFIG_PATH})"
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray else
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray ${DO} grep -v java.util.logging.FileHandler.pattern "${LOGGER_CONF_SOURCE}" > "${LOGGER_CONFIG_PATH}"
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray ${DO} grep java.util.logging.FileHandler.pattern "${LOGGER_CONF_SOURCE}" | sed "s|opengrok%g.%u.log|${OPENGROK_INSTANCE_BASE}/log/opengrok%g.%u.log|g" >> "${LOGGER_CONFIG_PATH}"
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray ${DO} mkdir ${OPENGROK_INSTANCE_BASE}/log
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray fi
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray fi
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray}
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray
d2a02e104622a26dd90fa88f4f17188f2039809fPeter BrayStdInvocation()
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray{
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray ${DO} ${JAVA} ${JAVA_OPTS} ${PROPERTIES} \
56d93b0c761868f813ac0bc0b5bc21a7a9fefd89Vladimir Kotal ${LOGGER_PROPERTIES} \
56d93b0c761868f813ac0bc0b5bc21a7a9fefd89Vladimir Kotal ${JAVA_DEBUG} \
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray -jar ${OPENGROK_JAR} \
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray ${IGNORE_PATTERNS} ${ENABLE_PROJECTS} \
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray ${DERBY_HISTORY_CACHE} \
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray ${SCAN_FOR_REPOSITORY} ${REMOTE_REPOSITORIES} \
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray ${VERBOSE} ${QUIET} \
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray ${EXUBERANT_CTAGS:+-c} ${EXUBERANT_CTAGS} \
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray ${MAX_INDEXED_WORDS} ${SKIN} ${LEADING_WILDCARD} \
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray ${READ_XML_CONF} \
cd348e325366620fe047edcc849e3c9424828599Peter Bray -W ${XML_CONFIGURATION} \
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray ${WEBAPP_CONFIG_ADDRESS} \
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray -s ${SRC_ROOT} -d ${DATA_ROOT} \
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray "${@}"
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray}
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray
56d93b0c761868f813ac0bc0b5bc21a7a9fefd89Vladimir KotalUpdateGeneratedData()
56d93b0c761868f813ac0bc0b5bc21a7a9fefd89Vladimir Kotal{
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray StdInvocation -H
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray}
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray
d2a02e104622a26dd90fa88f4f17188f2039809fPeter BrayUpdateDescriptionCache()
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray{
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray # OPTIONAL : Update the EftarFile data
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray if [ -n "${PATH_DESC}" -a -s "${PATH_DESC}" ]
578be34fc3aceb9831553e8611f8d5d59b711c3cVladimir Kotal then
0b2998be561e7bf5e3479d686a5af36f712b0d9aVladimir Kotal ${DO} ${JAVA} -classpath ${OPENGROK_JAR} \
578be34fc3aceb9831553e8611f8d5d59b711c3cVladimir Kotal ${EFTAR_UPDATE} ${PATH_DESC} ${EFTAR_OUTPUT_FILE}
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray fi
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray}
0b2998be561e7bf5e3479d686a5af36f712b0d9aVladimir Kotal
d2a02e104622a26dd90fa88f4f17188f2039809fPeter BrayOpenGrokUsage()
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray{
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray echo "Options for opengrok.jar:" 1>&2
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray ${DO} ${JAVA} ${JAVA_OPTS} -jar ${OPENGROK_JAR} '-?'
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray}
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray
0b2998be561e7bf5e3479d686a5af36f712b0d9aVladimir KotalDeployWar()
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray{
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray applicationServer="`FindApplicationServerType`"
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray case "${applicationServer}" in
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray Tomcat) warTarget="`DetermineWarDirectoryTomcat`" ;;
0b2998be561e7bf5e3479d686a5af36f712b0d9aVladimir Kotal Glassfish) warTarget="`DetermineWarDirectoryGlassfish`" ;;
0b2998be561e7bf5e3479d686a5af36f712b0d9aVladimir Kotal
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray *) FatalError "Unsupported Application Server ${applicationServer}" ;;
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray esac
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray if [ -z "${warTarget}" ]
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray then
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray FatalError "Unable to determine Deployment Directory for ${applicationServer}"
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray fi
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray if [ ! -f "${OPENGROK_DIST_WAR}" ]
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray then
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray FatalError "Missing Web Application Archive ${OPENGROK_DIST_WAR}"
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray fi
c577d2f6c082eaff9af5bc997d12f3d3bcef537cPeter Bray
c577d2f6c082eaff9af5bc997d12f3d3bcef537cPeter Bray if [ ! -d "${warTarget}" ]
c577d2f6c082eaff9af5bc997d12f3d3bcef537cPeter Bray then
c577d2f6c082eaff9af5bc997d12f3d3bcef537cPeter Bray FatalError "Missing Deployment Directory ${warTarget}"
c577d2f6c082eaff9af5bc997d12f3d3bcef537cPeter Bray fi
c577d2f6c082eaff9af5bc997d12f3d3bcef537cPeter Bray
c577d2f6c082eaff9af5bc997d12f3d3bcef537cPeter Bray Progress "Installing ${OPENGROK_DIST_WAR} to ${warTarget} ..."
477c09a2656e6a2c1075425ad81e61d594164fa9Lubos Kosco ${DO} cp "${OPENGROK_DIST_WAR}" "${warTarget}/"
477c09a2656e6a2c1075425ad81e61d594164fa9Lubos Kosco if [ $? != 0 ]
477c09a2656e6a2c1075425ad81e61d594164fa9Lubos Kosco then
56d93b0c761868f813ac0bc0b5bc21a7a9fefd89Vladimir Kotal FatalError "Web Application Installation FAILED"
56d93b0c761868f813ac0bc0b5bc21a7a9fefd89Vladimir Kotal fi
477c09a2656e6a2c1075425ad81e61d594164fa9Lubos Kosco
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray Progress
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray Progress "Start your application server (${applicationServer}), if it is not already"
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray Progress "running, or wait until it loads the just installed web application."
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray Progress
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray Progress "OpenGrok should be available on <HOST>:<PORT>/source"
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray Progress " where HOST and PORT are configured in ${applicationServer}."
477c09a2656e6a2c1075425ad81e61d594164fa9Lubos Kosco Progress
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray}
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray#
3aa0947feb67d3e8292d84776638be98dd97fdc3Lubos Kosco# Main Program
3aa0947feb67d3e8292d84776638be98dd97fdc3Lubos Kosco#
477c09a2656e6a2c1075425ad81e61d594164fa9Lubos Kosco
3aa0947feb67d3e8292d84776638be98dd97fdc3Lubos Koscoif [ $# -eq 0 -o $# -gt 2 ]
3aa0947feb67d3e8292d84776638be98dd97fdc3Lubos Koscothen
3aa0947feb67d3e8292d84776638be98dd97fdc3Lubos Kosco Usage
3aa0947feb67d3e8292d84776638be98dd97fdc3Lubos Koscofi
56d93b0c761868f813ac0bc0b5bc21a7a9fefd89Vladimir Kotal
56d93b0c761868f813ac0bc0b5bc21a7a9fefd89Vladimir KotalLoadStandardEnvironment
3aa0947feb67d3e8292d84776638be98dd97fdc3Lubos Kosco
3aa0947feb67d3e8292d84776638be98dd97fdc3Lubos KoscoLoadInstanceConfiguration
3aa0947feb67d3e8292d84776638be98dd97fdc3Lubos Kosco
3aa0947feb67d3e8292d84776638be98dd97fdc3Lubos Koscocase "${1}" in
3aa0947feb67d3e8292d84776638be98dd97fdc3Lubos Kosco
56d93b0c761868f813ac0bc0b5bc21a7a9fefd89Vladimir Kotal deploy)
56d93b0c761868f813ac0bc0b5bc21a7a9fefd89Vladimir Kotal DeployWar
3aa0947feb67d3e8292d84776638be98dd97fdc3Lubos Kosco ;;
3aa0947feb67d3e8292d84776638be98dd97fdc3Lubos Kosco
d280c5e286f5b98be13237f52281ae5afdcf51b9Peter Bray update)
5762c9f28c2246777be0e9d49cb29d9c0f49146dLubos Kosco ValidateConfiguration
d280c5e286f5b98be13237f52281ae5afdcf51b9Peter Bray CreateRuntimeRequirements
d280c5e286f5b98be13237f52281ae5afdcf51b9Peter Bray UpdateGeneratedData
d280c5e286f5b98be13237f52281ae5afdcf51b9Peter Bray UpdateDescriptionCache
c842732324ee4c74ede17887ad1f0dcdc4364a2cLubos Kosco ;;
c842732324ee4c74ede17887ad1f0dcdc4364a2cLubos Kosco
d280c5e286f5b98be13237f52281ae5afdcf51b9Peter Bray updateQuietly)
70a0fa770eb06713d8ebf91093102044bc5799e0Lubos Kosco ValidateConfiguration
56d93b0c761868f813ac0bc0b5bc21a7a9fefd89Vladimir Kotal CreateRuntimeRequirements
56d93b0c761868f813ac0bc0b5bc21a7a9fefd89Vladimir Kotal QUIET="-q"
56d93b0c761868f813ac0bc0b5bc21a7a9fefd89Vladimir Kotal VERBOSE=""
0b2998be561e7bf5e3479d686a5af36f712b0d9aVladimir Kotal UpdateGeneratedData
56d93b0c761868f813ac0bc0b5bc21a7a9fefd89Vladimir Kotal UpdateDescriptionCache
0b2998be561e7bf5e3479d686a5af36f712b0d9aVladimir Kotal ;;
0b2998be561e7bf5e3479d686a5af36f712b0d9aVladimir Kotal
0b2998be561e7bf5e3479d686a5af36f712b0d9aVladimir Kotal index)
0b2998be561e7bf5e3479d686a5af36f712b0d9aVladimir Kotal if [ -n "${2}" ]
56d93b0c761868f813ac0bc0b5bc21a7a9fefd89Vladimir Kotal then
0b2998be561e7bf5e3479d686a5af36f712b0d9aVladimir Kotal SRC_ROOT="${2}"
d280c5e286f5b98be13237f52281ae5afdcf51b9Peter Bray fi
5762c9f28c2246777be0e9d49cb29d9c0f49146dLubos Kosco ValidateConfiguration
477c09a2656e6a2c1075425ad81e61d594164fa9Lubos Kosco CreateRuntimeRequirements
477c09a2656e6a2c1075425ad81e61d594164fa9Lubos Kosco UpdateGeneratedData
477c09a2656e6a2c1075425ad81e61d594164fa9Lubos Kosco UpdateDescriptionCache
56d93b0c761868f813ac0bc0b5bc21a7a9fefd89Vladimir Kotal ;;
56d93b0c761868f813ac0bc0b5bc21a7a9fefd89Vladimir Kotal
56d93b0c761868f813ac0bc0b5bc21a7a9fefd89Vladimir Kotal usage)
56d93b0c761868f813ac0bc0b5bc21a7a9fefd89Vladimir Kotal OpenGrokUsage
56d93b0c761868f813ac0bc0b5bc21a7a9fefd89Vladimir Kotal Usage
56d93b0c761868f813ac0bc0b5bc21a7a9fefd89Vladimir Kotal ;;
56d93b0c761868f813ac0bc0b5bc21a7a9fefd89Vladimir Kotal
477c09a2656e6a2c1075425ad81e61d594164fa9Lubos Kosco *)
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray Usage
cd348e325366620fe047edcc849e3c9424828599Peter Bray ;;
cd348e325366620fe047edcc849e3c9424828599Peter Bray
cd348e325366620fe047edcc849e3c9424828599Peter Brayesac
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray
d280c5e286f5b98be13237f52281ae5afdcf51b9Peter Bray#
2b024356b830395446c55f50f9f724a63612e578Lubos Kosco# End of File
d2a02e104622a26dd90fa88f4f17188f2039809fPeter Bray#
d280c5e286f5b98be13237f52281ae5afdcf51b9Peter Bray