OpenGrok revision d70dc22c6dce3f498251b0873638d1fea0e644a3
01f87b9746ac246340e0e98d25e03193d83b071fJoe Bandenburg# OpenGrok Wrapper (initial setup and cron job updating)
01f87b9746ac246340e0e98d25e03193d83b071fJoe Bandenburg# Supported Operating Systems:
01f87b9746ac246340e0e98d25e03193d83b071fJoe Bandenburg# - Solaris 10 (SunOS 5.10)
01f87b9746ac246340e0e98d25e03193d83b071fJoe Bandenburg# - OpenSolaris (SunOS 5.11)
01f87b9746ac246340e0e98d25e03193d83b071fJoe Bandenburg# - Debian (Linux)
01f87b9746ac246340e0e98d25e03193d83b071fJoe Bandenburg# Supported Deployment Engines:
01f87b9746ac246340e0e98d25e03193d83b071fJoe Bandenburg# - Tomcat 5.5
01f87b9746ac246340e0e98d25e03193d83b071fJoe Bandenburg# Supported Environment Variables:
01f87b9746ac246340e0e98d25e03193d83b071fJoe Bandenburg# - OPENGROK_NON_INTERACTIVE Suppress Progress and Warnings Messages (*)
01f87b9746ac246340e0e98d25e03193d83b071fJoe Bandenburg# - OPENGROK_STANDARD_ENV Run Time Shell Environment (Shell Script)
01f87b9746ac246340e0e98d25e03193d83b071fJoe Bandenburg# - OPENGROK_CONFIGURATION User Configuration (Shell Script)
01f87b9746ac246340e0e98d25e03193d83b071fJoe Bandenburg# Supported Environment Variables for configuring the default setup:
01f87b9746ac246340e0e98d25e03193d83b071fJoe Bandenburg# - OPENGROK_DISTRIBUTION_BASE Base Directory of the OpenGrok Distribution
01f87b9746ac246340e0e98d25e03193d83b071fJoe Bandenburg# - OPENGROK_INSTANCE_BASE Base Directory of the OpenGrok User Data Area
01f87b9746ac246340e0e98d25e03193d83b071fJoe Bandenburg# - EXUBERANT_CTAGS Full Path to Exuberant CTags
01f87b9746ac246340e0e98d25e03193d83b071fJoe Bandenburg# - JAVA_HOME Full Path to Java Installation Root
01f87b9746ac246340e0e98d25e03193d83b071fJoe Bandenburg# - OPENGROK_APP_SERVER Application Server ("Tomcat" or "Glassfish")
01f87b9746ac246340e0e98d25e03193d83b071fJoe Bandenburg# - OPENGROK_WAR_TARGET_TOMCAT Tomcat Specific WAR Target Directory
01f87b9746ac246340e0e98d25e03193d83b071fJoe Bandenburg# - OPENGROK_WAR_TARGET_GLASSFISH Glassfish Specific WAR Target Directory
01f87b9746ac246340e0e98d25e03193d83b071fJoe Bandenburg# - OPENGROK_WAR_TARGET Fallback WAR Target Directory
01f87b9746ac246340e0e98d25e03193d83b071fJoe Bandenburg# - OPENGROK_TOMCAT_BASE Base Directory for Tomcat (contains webapps)
01f87b9746ac246340e0e98d25e03193d83b071fJoe Bandenburg# - OPENGROK_GLASSFISH_BASE Base Directory for Glassfish (contains domains)
01f87b9746ac246340e0e98d25e03193d83b071fJoe Bandenburg# - OPENGROK_GLASSFISH_DOMAIN Preferred Glassfish Domain Name
01f87b9746ac246340e0e98d25e03193d83b071fJoe Bandenburg# - OPENGROK_VERBOSE Enable Verbose Mode in opengrok.jar (*)
01f87b9746ac246340e0e98d25e03193d83b071fJoe Bandenburg# - OPENGROK_REMOTE_REPOS Disable History Cache for (remote) Repositories (*)
01f87b9746ac246340e0e98d25e03193d83b071fJoe Bandenburg# - OPENGROK_SCAN_REPOS Disable Scan for repositories (*)_
01f87b9746ac246340e0e98d25e03193d83b071fJoe Bandenburg# - OPENGROK_SCAN_DEPTH how deep should scanning for repos go (by default 3 directories from SRC_ROOT)
01f87b9746ac246340e0e98d25e03193d83b071fJoe Bandenburg# - READ_XML_CONFIGURATION file with read only configuration - a temp workaround for bug # 327
6da6692846ac189aa8a6b1b897fb03f6d7bf34aePhil Ostler# (*) Any Non-Empty String will enable these options
01f87b9746ac246340e0e98d25e03193d83b071fJoe Bandenburg echo "Usage: ${0} <deploy|update|updateQuietly|usage>" 1>&2
01f87b9746ac246340e0e98d25e03193d83b071fJoe Bandenburg echo " OPENGROK_CONFIGURATION - location of your configuration" 1>&2
01f87b9746ac246340e0e98d25e03193d83b071fJoe Bandenburg echo " e.g. $ OPENGROK_CONFIGURATION=/var/opengrok/myog.conf ${0} ... " 1>&2
01f87b9746ac246340e0e98d25e03193d83b071fJoe Bandenburg echo " See the code for more information on configuration options / variables" 1>&2
01f87b9746ac246340e0e98d25e03193d83b071fJoe Bandenburg# Runtime Configuration
01f87b9746ac246340e0e98d25e03193d83b071fJoe Bandenburg# TODO: Handle symlinks correctly (especially in ${0})
01f87b9746ac246340e0e98d25e03193d83b071fJoe BandenburgSCRIPT_DIRECTORY="`cd ${SCRIPT_DIRECTORY}; pwd`"
export JAVA_HOME
# DEVELOPMENT: Debug option, if enabled current indexer will listen on the port 8010 until a debugger connects
${CVS:+-Dorg.opensolaris.opengrok.history.cvs=$CVS} \
${SCCS:+-Dorg.opensolaris.opengrok.history.SCCS=$SCCS} \
${CLEARCASE:+-Dorg.opensolaris.opengrok.history.ClearCase=$CLEARCASE} \
${GIT:+-Dorg.opensolaris.opengrok.history.git=$GIT} \
${DO} exit 2
${OPENGROK_TOMCAT_BASE} \
${DO} grep -v java.util.logging.FileHandler.pattern "${LOGGER_CONF_SOURCE}" > "${LOGGER_CONFIG_PATH}"
${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}"
${DO} mkdir ${OPENGROK_INSTANCE_BASE}/log
${DO} ${JAVA} ${JAVA_OPTS} ${PROPERTIES} \
${LOGGER_PROPERTIES} \
${JAVA_DEBUG} \
-jar ${OPENGROK_JAR} \
${IGNORE_PATTERNS} ${ENABLE_PROJECTS} \
${DERBY_HISTORY_CACHE} \
${SCAN_DEPTH} \
${EXUBERANT_CTAGS:+-c} ${EXUBERANT_CTAGS} \
${MAX_INDEXED_WORDS} ${SKIN} ${LEADING_WILDCARD} \
${READ_XML_CONF} \
-W ${XML_CONFIGURATION} \
${DO} ${JAVA} -classpath ${OPENGROK_JAR} \
${EFTAR_UPDATE} ${PATH_DESC} ${EFTAR_OUTPUT_FILE}