1 #!/bin/sh 2 # 3 # OpenGrok Wrapper (initial setup and cron job updating) 4 # 5 # Supported Operating Systems: 6 # - Solaris 10 (SunOS 5.10) 7 # - OpenSolaris (SunOS 5.11) 8 # - Debian (Linux) 9 # 10 # Supported Deployment Engines: 11 # - Tomcat 6 12 # - Tomcat 5.5 13 # - Glassfish 14 # 15 # Supported Environment Variables: 16 # - OPENGROK_NON_INTERACTIVE Suppress Progress and Warnings Messages (*) 17 # - OPENGROK_STANDARD_ENV Run Time Shell Environment (Shell Script) 18 # - OPENGROK_CONFIGURATION User Configuration (Shell Script) 19 # 20 # Supported Environment Variables for configuring the default setup: 21 # - OPENGROK_DISTRIBUTION_BASE Base Directory of the OpenGrok Distribution 22 # - OPENGROK_INSTANCE_BASE Base Directory of the OpenGrok User Data Area 23 # - EXUBERANT_CTAGS Full Path to Exuberant CTags 24 # - JAVA_HOME Full Path to Java Installation Root 25 # - OPENGROK_APP_SERVER Application Server ("Tomcat" or "Glassfish") 26 # - OPENGROK_WAR_TARGET_TOMCAT Tomcat Specific WAR Target Directory 27 # - OPENGROK_WAR_TARGET_GLASSFISH Glassfish Specific WAR Target Directory 28 # - OPENGROK_WAR_TARGET Fallback WAR Target Directory 29 # - OPENGROK_TOMCAT_BASE Base Directory for Tomcat (contains webapps) 30 # - OPENGROK_GLASSFISH_BASE Base Directory for Glassfish (contains domains) 31 # - OPENGROK_GLASSFISH_DOMAIN Preferred Glassfish Domain Name 32 # - OPENGROK_VERBOSE Enable Verbose Mode in opengrok.jar (*) 33 # - OPENGROK_REMOTE_REPOS Enable History Cache for Remote Repositories (*) 34 # 35 # Notes: 36 # (*) Any Non-Empty String will enable these options 37 # 38 39 # 40 # Usage 41 # 42 43 Usage() 44 { 45 echo 1>&2 46 echo "Usage: ${0} <deploy|update|updateQuietly|usage>" 1>&2 47 echo " ${0} index [<directory>]" 1>&2 48 echo 1>&2 49 echo " Optional environment variables:" 1>&2 50 echo " OPENGROK_CONFIGURATION - location of your configuartion" 1>&2 51 echo " e.g. $ OPENGROK_CONFIGURATION=/var/opengrok/myog.conf ${0} ... " 1>&2 52 echo 1>&2 53 echo " See the code for more information on configuration options / variables" 1>&2 54 echo 1>&2 55 exit 1 56 } 57 58 # 59 # Runtime Configuration 60 # 61 62 OS_NAME="`/bin/uname -s`" 63 OS_VERSION="`/bin/uname -r`" 64 65 # TODO: Handle symlinks correctly (especially in ${0}) 66 SCRIPT_DIRECTORY="`dirname ${0}`" 67 SCRIPT_DIRECTORY="`cd ${SCRIPT_DIRECTORY}; pwd`" 68 69 # 70 # Default Instance Configuration 71 # 72 73 DefaultInstanceConfiguration() 74 { 75 # Use the built-in defaults. This section can be copied to its own 76 # file and tailored to your local requirements. Then simply set 77 # OPENGROK_CONFIGURATION=/path/to/your/configuration, before using 78 # this wrapper. It will save you hand editing in your settings 79 # on each new release. A sample cron(1M) entry might look like: 80 # 15 0 * * * OPENGROK_CONFIGURATION=/pkgs/etc/OpenGrok.sh /pkgs/sbin/OpenGrok updateQuietly 81 82 # Note: It is not really possible to ever provided defaults for 83 # these values which will run in every UNIX-like environment. 84 # So I have provided a set which are functional for a given 85 # environment on which you can based you own configuration. 86 87 # This has been updated to support more environment variables and 88 # operating systems, if you have any reasonably generic 89 # improvements please feel free to submit a patch. 90 91 OPENGROK_INSTANCE_BASE="${OPENGROK_INSTANCE_BASE:-/var/opengrok}" 92 93 LOGGER_CONFIG_FILE="logging.properties" 94 95 if [ -z "${OPENGROK_DISTRIBUTION_BASE}" ] 96 then 97 if [ -d "${SCRIPT_DIRECTORY}/dist" -a \ 98 -f "${SCRIPT_DIRECTORY}/dist/opengrok.jar" -a \ 99 -f "${SCRIPT_DIRECTORY}/dist/source.war" \ 100 ] 101 then 102 # Handle Developer Build Environments 103 OPENGROK_DISTRIBUTION_BASE="${SCRIPT_DIRECTORY}/dist" 104 LOGGER_CONF_SOURCE="${SCRIPT_DIRECTORY}/conf/${LOGGER_CONFIG_FILE}" 105 else 106 # Handle Binary Distributions 107 OPENGROK_DISTRIBUTION_BASE="${SCRIPT_DIRECTORY}" 108 LOGGER_CONF_SOURCE="${OPENGROK_DISTRIBUTION_BASE}/doc/${LOGGER_CONFIG_FILE}" 109 fi 110 fi 111 112 # REQUIRED: Source Code/Repository Root 113 # (your source code or the root of all repositories) 114 SRC_ROOT="${OPENGROK_INSTANCE_BASE}/src" 115 116 # REQUIRED: OpenGrok Generate Data Root 117 # (for Lucene index and hypertext cross-references) 118 # This area is rebuilt by "update" / "updateQuietly" 119 DATA_ROOT="${OPENGROK_INSTANCE_BASE}/data" 120 121 # OPTIONAL: User Provided Source Path to Description Mapping (Tab Separated Value) 122 # (The user maintained source of the generated EftarFile file) 123 PATH_DESC="${OPENGROK_INSTANCE_BASE}/etc/paths.tsv" 124 125 # REQUIRED: XML Configuration 126 # (the configuration used by Web/GUI interfaces) 127 XML_CONFIGURATION="${OPENGROK_INSTANCE_BASE}/etc/configuration.xml" 128 129 # TODO: Verify that Logger Configuration is REQUIRED and not OPTIONAL 130 # REQUIRED: Logger Configuration 131 LOGGER_CONFIG_PATH="${OPENGROK_INSTANCE_BASE}/${LOGGER_CONFIG_FILE}" 132 LOGGER_PROPERTIES="-Djava.util.logging.config.file=${LOGGER_CONFIG_PATH}" 133 134 # REQUIRED: Java Archive of OpenGrok (Installation Location) 135 OPENGROK_JAR="${OPENGROK_DISTRIBUTION_BASE}/opengrok.jar" 136 137 # REQUIRED(deploy): Web Archive of OpenGrok (Distribution Location) 138 # (user building from source code will find this and other key 139 # files in the "dist" directory after the build is completed) 140 OPENGROK_DIST_WAR="${OPENGROK_DISTRIBUTION_BASE}/source.war" 141 142 # REQUIRED: Exuberant CTags (http://ctags.sf.net) 143 EXUBERANT_CTAGS="${EXUBERANT_CTAGS:-`FindExuberantCTags`}" 144 145 # REQUIRED: Java Home 146 JAVA_HOME="${JAVA_HOME:-`FindJavaHome`}" 147 export JAVA_HOME 148 149 # REQUIRED: Java Virtual Machine 150 JAVA="${JAVA:-$JAVA_HOME/bin/java}" 151 152 # DEVELOPMENT: Debug option, if enabled current indexer will listen on the port 8010 until a debugger connects 153 #JAVA_DEBUG="-agentlib:jdwp=transport=dt_socket,server=y,address=8010,suspend=y" 154 155 # OPTIONAL: Ignore these patterns as names of files or directories 156 #IGNORE_PATTERNS="-i dummy" 157 158 # OPTIONAL: Enable Projects 159 # (Every directory in SRC_ROOT is considered a separate project) 160 ENABLE_PROJECTS="-P" 161 162 # OPTIONAL: Scanning Options (for Mercurial repositories) 163 SCAN_FOR_REPOSITORY="-S" 164 165 # OPTIONAL: Remote Repository Support (CVS or SVN) 166 # (Can be very time demanding, uncomment if needed) 167 #REMOTE_REPOSITORIES="-r on" 168 if [ ! -z "${OPENGROK_REMOTE_REPOS}" ] 169 then 170 REMOTE_REPOSITORIES="-r on" 171 fi 172 173 # OPTIONAL: Allow Leading Wildcard Searches 174 # (default: off) 175 #LEADING_WILDCARD="-a on" 176 177 # OPTIONAL: Web Site Look & Feel 178 # (Options: default, offwhite and polished. 179 # Note the quoting requirements) 180 #SKIN='-L "default"' 181 182 # OPTIONAL: Set Maximum Indexed Words Per File 183 # Note, that you might run out of memory, then either increase JVM memory 184 # as noted in JAVA_OPTS, or set this limit(if you don't mind opengrok not 185 # indexing the rest of the file, once the limit is reached) 186 # (default: unlimited) 187 #MAX_INDEXED_WORDS="-m 100000" 188 MAX_INDEXED_WORDS="-m 10000" 189 190 # OPTIONAL: Configuration Address (host:port) 191 # (conf/web.xml default is localhost:2424) 192 WEBAPP_CONFIG_ADDRESS="-U localhost:2424" 193 194 # OPTIONAL: JVM Options 195 #JAVA_OPTS="-server -Xmx1024m" 196 197 # OPTIONAL: Full Path to History Utilities 198 HG="`Which hg`" 199 CVS="`Which cvs`" 200 SVN="`Which svn`" 201 SCCS="`Which sccs`" 202 CLEARCASE="`Which cleartool`" 203 GIT="`Which git`" 204 P4="`Which p4`" 205 MTN="`Which mtn`" 206 BZR="`Which bzr`" 207 208 # OPTIONAL: Override Built-in Properties 209 # Assumption: We should not set properties to the empty string 210 PROPERTIES="\ 211 ${HG:+-Dorg.opensolaris.opengrok.history.Mercurial=$HG} \ 212 ${CVS:+-Dorg.opensolaris.opengrok.history.cvs=$CVS} \ 213 ${SVN:+-Dorg.opensolaris.opengrok.history.Subversion=$SVN} \ 214 ${SCCS:+-Dorg.opensolaris.opengrok.history.SCCS=$SCCS} \ 215 ${CLEARCASE:+-Dorg.opensolaris.opengrok.history.ClearCase=$CLEARCASE} \ 216 ${GIT:+-Dorg.opensolaris.opengrok.history.git=$GIT} \ 217 ${P4:+-Dorg.opensolaris.opengrok.history.Perforce=$P4} \ 218 ${MTN:+-Dorg.opensolaris.opengrok.history.Monotone=$MTN} \ 219 ${BZR:+-Dorg.opensolaris.opengrok.history.Bazaar=$BZR} \ 220 " 221 222 # OPTIONAL: Store The History Cache in Java DB (derby), 223 # instead of file system (in gzipped xml files). 224 # 225 # Requirements: 226 # - derbyclient.jar - See README.txt for more details 227 # - Running Derby Server - Defaults to localhost:1527 228 # 229 #DERBY_HISTORY_CACHE=-D 230 231 # DELIVERED: An update program for EftarFile 232 # Usage: <class> inputFile [inputFile ...] outputFile 233 # EftarFile == An Extremely Fast Tagged Attribute Read-only File System 234 EFTAR_UPDATE="org.opensolaris.opengrok.web.EftarFile" 235 236 # HARDCODED: Generated EftarFile (See web/*.jsp) 237 EFTAR_OUTPUT_FILE="${DATA_ROOT}/index/dtags.eftar" 238 239 # Be Quiet? (set indirectly by command line arguments in the main program) 240 #QUIET="" 241 242 # or alternatively, Be Verbose! 243 #VERBOSE="-v" 244 245 if [ ! -z "${OPENGROK_VERBOSE}" ] 246 then 247 VERBOSE="-v" 248 QUIET="" 249 fi 250 } 251 252 # 253 # Helper Functions - Logging 254 # 255 # In general, non-interactive use like cron jobs and automated 256 # installation environments should not generate unnecessary 257 # progress information or warnings, as usage and configuration 258 # will have generally been debugged prior to automation. 259 # 260 261 Progress() 262 { 263 if [ -z "${OPENGROK_NON_INTERACTIVE}" ] 264 then 265 echo "${@}" 266 fi 267 } 268 269 Warning() 270 { 271 if [ -z "${OPENGROK_NON_INTERACTIVE}" ] 272 then 273 echo "WARNING: ${@}" 1>&2 274 fi 275 } 276 277 Error() 278 { 279 echo "ERROR: ${@}" 1>&2 280 } 281 282 FatalError() 283 { 284 echo 1>&2 285 echo "FATAL ERROR: ${@} - Aborting!" 1>&2 286 echo 1>&2 287 ${DO} exit 2 288 } 289 290 # 291 # Helper Functions - Autodetection of Runtime Environment 292 # 293 294 Which() 295 { 296 path="`which ${1} 2>/dev/null`" 297 298 if [ -x "${path}" ] 299 then 300 echo "${path}" 301 fi 302 } 303 304 FindExuberantCTags() 305 { 306 case "${OS_NAME}:${OS_VERSION}" in 307 SunOS:5.10) commandName="" ;; 308 SunOS:5.11) commandName="exctags" ;; 309 Linux:*) commandName="ctags-exuberant" ;; 310 *) commandName="" ;; 311 esac 312 313 if [ -z "${commandName}" ] 314 then 315 Error "Unable to determine Exuberant CTags command name" \ 316 "for ${OS_NAME} ${OS_VERSION}" 317 return 318 fi 319 320 Which "${commandName}" 321 } 322 323 FindJavaHome() 324 { 325 case "${OS_NAME}:${OS_VERSION}" in 326 SunOS:5.10) javaHome="/usr/jdk/instances/jdk1.6.0" ;; 327 SunOS:5.11) javaHome="/usr/jdk/latest" ;; 328 Linux:*) javaHome="/usr/lib/jvm/java-6-sun" ;; 329 *) javaHome="" ;; 330 esac 331 332 if [ -z "${javaHome}" ] 333 then 334 Error "Unable to determine Java 6 Home" \ 335 "for ${OS_NAME} ${OS_VERSION}" 336 return 337 fi 338 339 if [ ! -d "${javaHome}" ] 340 then 341 Error "Missing Java Home ${javaHome}" 342 return 343 fi 344 345 echo "${javaHome}" 346 } 347 348 FindApplicationServerType() 349 { 350 # Use this function to determine which environment the deploy the 351 # web application function into. Some users (especially 352 # developers) will have many deployment environments or will wish 353 # to specify directly the application server to deploy to. 354 355 # Either use the environment variable OPENGROK_APP_SERVER or 356 # reimplement this function in your configuration file (as 357 # specified by OPENGROK_CONFIGURATION) 358 359 if [ -n "${OPENGROK_APP_SERVER}" ] 360 then 361 echo "${OPENGROK_APP_SERVER}" 362 return 363 fi 364 365 # This implementation favours Tomcat, but needs a lot of work, 366 # especially if Glassfish is perferrerd or it is under the control 367 # of SMF (Service Management Facility) 368 369 # Maybe a better implementation would be to call Application 370 # Server specific WAR Directory and see if they exist. 371 372 if [ -d "/var/tomcat6/webapps" \ 373 -o -d "/var/lib/tomcat6/webapps" \ 374 -o -d "/var/lib/tomcat5.5/webapps" \ 375 ] 376 then 377 echo "Tomcat" 378 return 379 fi 380 381 if [ -x "/etc/init.d/appserv" -a -d "/var/appserver/domains" ] 382 then 383 echo "Glassfish" 384 return 385 fi 386 387 # Assume Tomcat 388 echo "Tomcat" 389 } 390 391 DetermineWarDirectoryTomcat() 392 { 393 if [ -n "${OPENGROK_WAR_TARGET_TOMCAT}" ] 394 then 395 echo "${OPENGROK_WAR_TARGET_TOMCAT}" 396 return 397 elif [ -n "${OPENGROK_WAR_TARGET}" ] 398 then 399 echo "${OPENGROK_WAR_TARGET}" 400 return 401 fi 402 403 for prefix in \ 404 ${OPENGROK_TOMCAT_BASE} \ 405 /var/tomcat6 \ 406 /var/lib/tomcat6 \ 407 /var/lib/tomcat5.5 \ 408 409 do 410 if [ -d "${prefix}/webapps" ] 411 then 412 echo "${prefix}/webapps" 413 return 414 fi 415 done 416 } 417 418 DetermineWarDirectoryGlassfish() 419 { 420 421 if [ -n "${OPENGROK_WAR_TARGET_GLASSFISH}" ] 422 then 423 echo "${OPENGROK_WAR_TARGET_GLASSFISH}" 424 return 425 elif [ -n "${OPENGROK_WAR_TARGET}" ] 426 then 427 echo "${OPENGROK_WAR_TARGET}" 428 return 429 fi 430 431 for prefix in \ 432 ${OPENGROK_GLASSFISH_BASE} \ 433 /var/appserver \ 434 435 do 436 if [ -d "${prefix}/domains" ] 437 then 438 if [ -z "${domainDirectory}" ] 439 then 440 domainDirectory="${prefix}/domains" 441 fi 442 fi 443 done 444 445 if [ -z "${domainDirectory}" ] 446 then 447 return 448 fi 449 450 # User Specified Domain 451 if [ -n "${OPENGROK_GLASSFISH_DOMAIN}" ] 452 then 453 directory="${domainDirectory}/${OPENGROK_GLASSFISH_DOMAIN}/autodeploy" 454 455 if [ ! -d "${directory}" ] 456 then 457 FatalError "Missing Specified Glassfish Domain ${OPENGROK_GLASSFISH_DOMAIN}" 458 fi 459 460 echo "${directory}" 461 return 462 fi 463 464 # Arbitrary Domain Selection 465 firstDomain=`ls -1 ${domainDirectory} | head -1` 466 467 if [ -z "${firstDomain}" ] 468 then 469 FatalError "Failed to dynamically determine Glassfish Domain from ${domainDirectory}" 470 fi 471 472 echo "${domainDirectory}/${firstDomain}/autodeploy" 473 } 474 475 # 476 # Implementation 477 # 478 # The variable "DO" can usefully be set to "echo" to aid in script debugging 479 # 480 481 LoadStandardEnvironment() 482 { 483 # Setup a standard execution environment (if required) 484 485 OPENGROK_STANDARD_ENV="${OPENGROK_STANDARD_ENV:-/pkgs/sbin/CronExecutionEnvironment.sh}" 486 487 if [ -f "${OPENGROK_STANDARD_ENV}" ] 488 then 489 Progress "Loading ${OPENGROK_STANDARD_ENV} ..." 490 . "${OPENGROK_STANDARD_ENV}" 491 fi 492 } 493 494 LoadInstanceConfiguration() 495 { 496 # Note: As all functions have been defined by the time this routine 497 # is called, your configuration can, if desired, override functions 498 # in addition to setting the variables mentioned in the function 499 # DefaultInstanceConfiguration(), this maybe useful to override 500 # functionality used to determine the default deployment environment 501 # find dependencies or validate the configuration, for example. 502 503 if [ -n "${OPENGROK_CONFIGURATION}" -a -f "${OPENGROK_CONFIGURATION}" ] 504 then 505 # Load the Local OpenGrok Configuration Environment 506 Progress "Loading ${OPENGROK_CONFIGURATION} ..." 507 . "${OPENGROK_CONFIGURATION}" 508 else 509 Progress "Loading the default instance configuration ..." 510 DefaultInstanceConfiguration 511 fi 512 } 513 514 ValidateConfiguration() 515 { 516 if [ ! -x "${EXUBERANT_CTAGS}" ] 517 then 518 FatalError "Missing Dependent Application - Exuberant CTags" 519 fi 520 521 if [ ! -d "${SRC_ROOT}" ] 522 then 523 FatalError "OpenGrok Source Path ${SRC_ROOT} doesn't exist" 524 fi 525 526 if [ -n "${QUIET}" -a -n "${VERBOSE}" ] 527 then 528 Warning "Both Quiet and Verbose Mode Enabled - Choosing Verbose" 529 QUIET="" 530 VERBOSE="-v" 531 fi 532 } 533 534 CreateRuntimeRequirements() 535 { 536 if [ ! -d "${DATA_ROOT}" ] 537 then 538 Warning "OpenGrok Generated Data Path ${DATA_ROOT} doesn't exist" 539 Progress " Attempting to create generated data directory ... " 540 ${DO} mkdir -p "${DATA_ROOT}" 541 fi 542 if [ ! -d "${DATA_ROOT}" ] 543 then 544 FatalError "OpenGrok Data Path ${DATA_ROOT} doesn't exist" 545 fi 546 547 if [ ! -d "${OPENGROK_INSTANCE_BASE}/etc" ] 548 then 549 Warning "OpenGrok Generated Etc Path ${OPENGROK_INSTANCE_BASE}/etc doesn't exist" 550 Progress " Attempting to create generated etc directory ... " 551 ${DO} mkdir -p "${OPENGROK_INSTANCE_BASE}/etc" 552 fi 553 if [ ! -d "${OPENGROK_INSTANCE_BASE}/etc" ] 554 then 555 FatalError "OpenGrok Etc Path ${OPENGROK_INSTANCE_BASE}/etc doesn't exist" 556 fi 557 558 if [ -n "${LOGGER_CONFIG_PATH}" -a ! -f "${LOGGER_CONFIG_PATH}" ] 559 then 560 Progress " Creating default ${LOGGER_CONFIG_PATH} ... " 561 if [ ! -f "${LOGGER_CONF_SOURCE}" ] 562 then 563 FatalError "Can't find distribution logging configuration" 564 "(${LOGGER_CONF_SOURCE}) to install as default" 565 "logging configuration (${LOGGER_CONFIG_PATH})" 566 fi 567 568 ${DO} cp "${LOGGER_CONF_SOURCE}" "${LOGGER_CONFIG_PATH}" 569 # TODO: Consider automatically setting the logging directory 570 # to within the instance base directory tree 571 fi 572 } 573 574 StdInvocation() 575 { 576 ${DO} ${JAVA} ${JAVA_OPTS} ${PROPERTIES} \ 577 ${LOGGER_PROPERTIES} \ 578 ${JAVA_DEBUG} \ 579 -jar ${OPENGROK_JAR} \ 580 ${IGNORE_PATTERNS} ${ENABLE_PROJECTS} \ 581 ${DERBY_HISTORY_CACHE} \ 582 ${SCAN_FOR_REPOSITORY} ${REMOTE_REPOSITORIES} \ 583 ${VERBOSE} ${QUIET} \ 584 ${EXUBERANT_CTAGS:+-c} ${EXUBERANT_CTAGS} \ 585 ${MAX_INDEXED_WORDS} ${SKIN} ${LEADING_WILDCARD} \ 586 -W ${XML_CONFIGURATION} \ 587 ${WEBAPP_CONFIG_ADDRESS} \ 588 -s ${SRC_ROOT} -d ${DATA_ROOT} \ 589 "${@}" 590 #? -R ${XML_CONFIGURATION} \ 591 592 } 593 594 UpdateGeneratedData() 595 { 596 StdInvocation -H 597 } 598 599 UpdateDescriptionCache() 600 { 601 # OPTIONAL : Update the EftarFile data 602 603 if [ -n "${PATH_DESC}" -a -s "${PATH_DESC}" ] 604 then 605 ${DO} ${JAVA} -classpath ${OPENGROK_JAR} \ 606 ${EFTAR_UPDATE} ${PATH_DESC} ${EFTAR_OUTPUT_FILE} 607 fi 608 } 609 610 OpenGrokUsage() 611 { 612 echo "Options for opengrok.jar:" 1>&2 613 ${DO} ${JAVA} ${JAVA_OPTS} -jar ${OPENGROK_JAR} '-?' 614 } 615 616 DeployWar() 617 { 618 applicationServer="`FindApplicationServerType`" 619 620 case "${applicationServer}" in 621 622 Tomcat) warTarget="`DetermineWarDirectoryTomcat`" ;; 623 Glassfish) warTarget="`DetermineWarDirectoryGlassfish`" ;; 624 625 *) FatalError "Unsupported Application Server ${applicationServer}" ;; 626 627 esac 628 629 if [ -z "${warTarget}" ] 630 then 631 FatalError "Unable to determine Deployment Directory for ${applicationServer}" 632 fi 633 634 if [ ! -f "${OPENGROK_DIST_WAR}" ] 635 then 636 FatalError "Missing Web Application Archive ${OPENGROK_DIST_WAR}" 637 fi 638 639 if [ ! -d "${warTarget}" ] 640 then 641 FatalError "Missing Deployment Directory ${warTarget}" 642 fi 643 644 Progress "Installing ${OPENGROK_DIST_WAR} to ${warTarget} ..." 645 ${DO} cp "${OPENGROK_DIST_WAR}" "${warTarget}/" 646 if [ $? != 0 ] 647 then 648 FatalError "Web Application Installation FAILED" 649 fi 650 651 Progress 652 Progress "Start your application server (${applicationServer}), if it is not already" 653 Progress "running, or wait until it loads the just installed web application." 654 Progress 655 Progress "OpenGrok should be available on <HOST>:<PORT>/source" 656 Progress " where HOST and PORT are configured in ${applicationServer}." 657 Progress 658 } 659 660 # 661 # Main Program 662 # 663 664 if [ $# -eq 0 -o $# -gt 2 ] 665 then 666 Usage 667 fi 668 669 LoadStandardEnvironment 670 671 LoadInstanceConfiguration 672 673 case "${1}" in 674 675 deploy) 676 DeployWar 677 ;; 678 679 update) 680 ValidateConfiguration 681 CreateRuntimeRequirements 682 UpdateGeneratedData 683 UpdateDescriptionCache 684 ;; 685 686 updateQuietly) 687 ValidateConfiguration 688 CreateRuntimeRequirements 689 QUIET="-q" 690 VERBOSE="" 691 UpdateGeneratedData 692 UpdateDescriptionCache 693 ;; 694 695 index) 696 if [ -n "${2}" ] 697 then 698 SRC_ROOT="${2}" 699 fi 700 ValidateConfiguration 701 CreateRuntimeRequirements 702 UpdateGeneratedData 703 UpdateDescriptionCache 704 ;; 705 706 usage) 707 OpenGrokUsage 708 Usage 709 ;; 710 711 *) 712 Usage 713 ;; 714 715 esac 716 717 # 718 # End of File 719 # 720