18
18
# CDDL HEADER END
19
19
20
20
#
21
- # OpenGrok Wrapper (initial setup and cron job updating)
22
- #
23
- # Supported Operating Systems:
24
- # - Solaris 11 (SunOS 5.11)
25
- # - Debian (Linux)
26
- #
27
- # Supported Deployment Engines:
28
- # - Tomcat 8
29
- # - Glassfish
30
- # - Resin
31
- #
32
- # Supported Environment Variables:
33
- # - OPENGROK_NON_INTERACTIVE Suppress Progress and Warnings Messages (*)
34
- # - OPENGROK_STANDARD_ENV Run Time Shell Environment (Shell Script)
35
- # - OPENGROK_CONFIGURATION User Configuration (Shell Script)
36
- #
37
- # Supported Environment Variables for configuring the default setup:
38
- # - OPENGROK_DISTRIBUTION_BASE Base Directory of the OpenGrok Distribution
39
- # - OPENGROK_INSTANCE_BASE Base Directory of the OpenGrok User Data Area
40
- # - OPENGROK_SRC_ROOT directory with files to be indexed
41
- # - OPENGROK_DATA_ROOT directory where index and cache files are generated
42
- # - OPENGROK_CTAGS Full path to Exuberant or Universal CTags binary
43
- # - OPENGROK_CTAGS_OPTIONS_FILE Full path to file with extra command line
44
- # options for CTags program (for its --options
45
- # switch), default is DATA_ROOT/etc/ctags.config
46
- # - OPENGROK_MANDOC Full path to mandoc(1) binary
47
- # - OPENGROK_LOCKING Locking mode on|off|simple|native (default off)
48
- # ("on" is an alias for "simple")
49
- # - JAVA_HOME Full Path to Java Installation Root
50
- # - JAVA Full Path to java binary (to enable 64bit JDK)
51
- # - JAVA_OPTS Java options (e.g. for JVM memory increase
52
- # or enabling server JDK)
53
- # JAVA_OPTS=-Xmx2048m is the default!
54
- # - OPENGROK_APP_SERVER Application Server ("Tomcat", "Glassfish" or "Resin")
55
- # - OPENGROK_WAR_TARGET_TOMCAT Tomcat Specific WAR Target Directory
56
- # - OPENGROK_WAR_TARGET_GLASSFISH Glassfish Specific WAR Target Directory
57
- # - OPENGROK_WAR_TARGET_RESIN Resin Specific WAR Target Directory
58
- # - OPENGROK_WAR_TARGET Fallback WAR Target Directory
59
- # - OPENGROK_TOMCAT_BASE Base Directory for Tomcat (contains webapps)
60
- # - OPENGROK_GLASSFISH_BASE Base Directory for Glassfish
61
- # (contains domains)
62
- # - OPENGROK_GLASSFISH_DOMAIN Preferred Glassfish Domain Name
63
- # - OPENGROK_RESIN_BASE Base Directory for Resin (contains webapps)
64
- # - OPENGROK_VERBOSE Enable Verbose Mode in opengrok.jar (*)
65
- # - OPENGROK_PROGRESS Shows progress in %(percentage) of working
66
- # through project, it's good to have Verbose
67
- # Mode enabled too, cost of this is one more
68
- # traversal of the project before indexing it(*)
69
- # - OPENGROK_RENAMED_FILES_HISTORY If set to "on", get full history of
70
- # renamed files for SCMs that support it (Git,
71
- # Mercurial).
72
- # The default is off.
73
- # When set to on, the indexing is slower,
74
- # especially in the presence of
75
- # lots of renamed files in the repository.
76
- # - OPENGROK_GENERATE_HISTORY Influence history cache generation
77
- # Following values are recognized:
78
- # on - enabled (default)
79
- # off - disabled for indexing and UI
80
- # dirbased - indexing enabled only for repos
81
- # which can fetch history for
82
- # directory
83
- # local - for local repos only
84
- # uionly - enabled for UI only
85
- # - OPENGROK_ENABLE_PROJECTS Enable projects (set it to true or false)
86
- # Every directory in SRC_ROOT is
87
- # considered a separate project
88
- # - OPENGROK_IGNORE_PATTERNS Set ignored patterns for indexer to skip.
89
- # OPENGROK_IGNORE_PATTERNS="-i dummy"
90
- # OPENGROK_IGNORE_PATTERNS="-i f:dummy"
91
- # OPENGROK_IGNORE_PATTERNS="-i d:dummy"
92
- # Multiple entries can be joined together:
93
- # "-i dummy -i d:tmp -i f:dummy"
94
- # - OPENGROK_SCAN_REPOS Disable Scan for repositories (*)
95
- # - OPENGROK_SCAN_DEPTH how deep should scanning for repos go
96
- # (by default 3 directories from SRC_ROOT)
97
- # - OPENGROK_WEBAPP_CFGADDR Web app address to send configuration to
98
- # (use "none" to avoid sending it to web app)
99
- # - OPENGROK_WEBAPP_CONTEXT Context URL of the OpenGrok webapp
100
- # (by default /source)
101
- # - FULL reindex is needed once this is used
102
- # (old already indexed files won't be refreshed)
103
- # - OPENGROK_WPREFIX Disable wildcard prefix search query
104
- # support (*)
105
- # - OPENGROK_TAG Enable parsing of revision tags into the History
106
- # view
107
- # - OPENGROK_READ_XML_CONFIGURATION file with read only configuration
108
- # - temporary workaround for bug # 327
109
- # - OPENGROK_FLUSH_RAM_BUFFER_SIZE="-m 16" - set RAM buffer size for flushing,
110
- # default is 16MB per thread, you might try to
111
- # increase it to 256MB, but do increase JVM to
112
- # 4/8/16GB ! Lucene defaults to 8 threads.
113
- # Increase JVM memory as noted using JAVA_OPTS
114
- # - OPENGROK_PARALLELISM Default is 0, meaning that parallelism is
115
- # determined from available processors.
116
- # - OPENGROK_LOGGER_CONFIG_PATH Set path to custom logging.properties file.
117
- # - OPENGROK_SUBVERSION_USERNAME name of the user that should be used for
118
- # fetching the history from subversion
119
- # - OPENGROK_SUBVERSION_PASSWORD password of the user that should be used for
120
- # fetching the history from subversion
121
- #
122
- # - OPENGROK_PROFILER Pause to await user input for profiling.
123
- #
124
- # Notes:
125
- # (*) Any Non-Empty String will enable these options
21
+ # Copyright (c) 2008, 2017, Oracle and/or its affiliates. All rights reserved.
22
+ # Portions Copyright (c) 2017-2018, Chris Fraire <[email protected] >.
126
23
#
127
24
128
25
#
129
- # Copyright (c) 2008, 2017, Oracle and/or its affiliates. All rights reserved .
130
- # Portions Copyright (c) 2017-2018, Chris Fraire <[email protected] > .
26
+ # opengrok.jar wrapper for initial setup and cron job updating .
27
+ # Please see the Usage() function below for supported environment variables .
131
28
#
132
29
133
30
#
@@ -139,22 +36,132 @@ Usage()
139
36
140
37
exec >&2
141
38
echo " "
142
- echo " Usage: ${progname} <bootstrap|deploy|update|updateQuietly|updateDesc|usage|help >"
39
+ echo " Usage: ${progname} <bootstrap|deploy|update|updateQuietly|updateDesc>"
143
40
echo " ${progname} index [<directory>]"
144
41
echo " ${progname} indexpart <directory_1> [<directory_2> ..]"
145
42
echo " ${progname} clearHistory <src_root> <repository_name>"
43
+ echo " ${progname} usage|help [--detailed]"
146
44
echo " "
147
45
echo " The \" indexpart\" assumes that it will be run with configuration"
148
46
echo " pointed to via the OPENGROK_READ_XML_CONFIGURATION environment"
149
47
echo " variable."
150
48
echo " "
151
- echo " Optional environment variables:"
152
- echo " OPENGROK_CONFIGURATION - location of your configuration"
153
- echo " e.g. $ OPENGROK_CONFIGURATION=/var/opengrok/myog.conf ${0} ... "
154
- echo " "
155
- echo " See the code for more information on configuration options /" \
156
- " variables"
157
- echo " "
49
+ if [ " $1 " != " --detailed" ]; then
50
+ echo " Optional environment variables:"
51
+ echo " OPENGROK_CONFIGURATION - location of your configuration"
52
+ echo " e.g. $ OPENGROK_CONFIGURATION=/var/opengrok/myog.conf \\ "
53
+ echo " ${0} ... "
54
+ echo " "
55
+ echo " Use help --detailed, or see the code for more information on"
56
+ echo " configuration options and variables."
57
+ else
58
+ cat << END
59
+ Supported Environment Variables:
60
+ - OPENGROK_CONFIGURATION User Configuration (Shell Script)
61
+ - OPENGROK_NON_INTERACTIVE Suppress Progress and Warnings Messages (*)
62
+ - OPENGROK_STANDARD_ENV Run Time Shell Environment (Shell Script)
63
+
64
+ Supported Environment Variables for configuring the default setup:
65
+ - OPENGROK_DISTRIBUTION_BASE Base Directory of the OpenGrok Distribution
66
+ - OPENGROK_INSTANCE_BASE Base Directory of the OpenGrok User Data Area
67
+ - OPENGROK_SRC_ROOT directory with files to be indexed
68
+ - OPENGROK_DATA_ROOT Base Directory where index and cache files are
69
+ generated
70
+ - OPENGROK_CTAGS Full path to Exuberant or Universal CTags binary
71
+ - OPENGROK_CTAGS_OPTIONS_FILE Full path to file with extra command line
72
+ options for CTags program (for its --options
73
+ switch), default is DATA_ROOT/etc/ctags.config
74
+ - OPENGROK_MANDOC Full path to mandoc(1) binary
75
+ - OPENGROK_LOCKING Locking mode on|off|simple|native (default off)
76
+ ("on" is an alias for "simple")
77
+ - JAVA_HOME Full Path to Java Installation Root
78
+ - JAVA Full Path to java binary (to enable 64bit JDK)
79
+ - JAVA_OPTS Java options (e.g. for JVM memory increase
80
+ or enabling server JDK)
81
+ JAVA_OPTS=-Xmx2048m is the default!
82
+ - OPENGROK_APP_SERVER Application Server ("Tomcat", "Glassfish" or
83
+ "Resin")
84
+ - OPENGROK_WAR_TARGET_TOMCAT Tomcat Specific WAR Target Directory
85
+ - OPENGROK_WAR_TARGET_GLASSFISH Glassfish Specific WAR Target Directory
86
+ - OPENGROK_WAR_TARGET_RESIN Resin Specific WAR Target Directory
87
+ - OPENGROK_WAR_TARGET Fallback WAR Target Directory
88
+ - OPENGROK_TOMCAT_BASE Base Directory for Tomcat (contains webapps)
89
+ - OPENGROK_GLASSFISH_BASE Base Directory for Glassfish
90
+ (contains domains)
91
+ - OPENGROK_GLASSFISH_DOMAIN Preferred Glassfish Domain Name
92
+ - OPENGROK_RESIN_BASE Base Directory for Resin (contains webapps)
93
+ - OPENGROK_VERBOSE Enable Verbose Mode in opengrok.jar (*)
94
+ - OPENGROK_PROGRESS Shows progress in %(percentage) of working
95
+ through project, it's good to have Verbose
96
+ Mode enabled too, cost of this is one more
97
+ traversal of the project before indexing it(*)
98
+ - OPENGROK_RENAMED_FILES_HISTORY If set to "on", get full history of
99
+ renamed files for SCMs that support it (Git,
100
+ Mercurial).
101
+ The default is off.
102
+ When set to on, the indexing is slower,
103
+ especially in the presence of
104
+ lots of renamed files in the repository.
105
+ - OPENGROK_GENERATE_HISTORY Influence history cache generation
106
+ Following values are recognized:
107
+ on - enabled (default)
108
+ off - disabled for indexing and UI
109
+ dirbased - indexing enabled only for
110
+ repos which can fetch history
111
+ for directory
112
+ local - for local repos only
113
+ uionly - enabled for UI only
114
+ - OPENGROK_ENABLE_PROJECTS Enable projects (set it to true or false)
115
+ Every directory in SRC_ROOT is
116
+ considered a separate project
117
+ - OPENGROK_IGNORE_PATTERNS Set ignored patterns for indexer to skip.
118
+ OPENGROK_IGNORE_PATTERNS="-i dummy"
119
+ OPENGROK_IGNORE_PATTERNS="-i f:dummy"
120
+ OPENGROK_IGNORE_PATTERNS="-i d:dummy"
121
+ Multiple entries can be joined together:
122
+ "-i dummy -i d:tmp -i f:dummy"
123
+ - OPENGROK_SCAN_REPOS Disable Scan for repositories (*)
124
+ - OPENGROK_SCAN_DEPTH how deep should scanning for repos go
125
+ (by default 3 directories from SRC_ROOT)
126
+ - OPENGROK_WEBAPP_CFGADDR Web app address to send configuration to
127
+ (use "none" to avoid sending it to web app)
128
+ - OPENGROK_WEBAPP_CONTEXT Context URL of the OpenGrok webapp
129
+ (by default /source)
130
+ - FULL reindex is needed once this is used
131
+ (old already indexed files won't be refreshed)
132
+ - OPENGROK_WPREFIX Disable wildcard prefix search query
133
+ support (*)
134
+ - OPENGROK_TAG Enable parsing of revision tags into the History
135
+ view
136
+ - OPENGROK_READ_XML_CONFIGURATION file with read only configuration
137
+ - temporary workaround for bug # 327
138
+ - OPENGROK_FLUSH_RAM_BUFFER_SIZE="-m 16" - set RAM buffer size for flushing,
139
+ default is 16MB per thread, you might try to
140
+ increase it to 256MB, but do increase JVM to
141
+ 4/8/16GB ! Lucene defaults to 8 threads.
142
+ Increase JVM memory as noted using JAVA_OPTS
143
+ - OPENGROK_PARALLELISM Default is 0, meaning that parallelism is
144
+ determined from available processors.
145
+ - OPENGROK_LOGGER_CONFIG_PATH Set path to custom logging.properties file.
146
+ - OPENGROK_SUBVERSION_USERNAME name of the user that should be used for
147
+ fetching the history from subversion
148
+ - OPENGROK_SUBVERSION_PASSWORD password of the user that should be used for
149
+ fetching the history from subversion
150
+ - OPENGROK_PROFILER Pause to await user input for profiling.
151
+
152
+ Notes:
153
+ (*) Any Non-Empty String will enable these options
154
+
155
+ Supported Operating Systems:
156
+ - Solaris 11 (SunOS 5.11)
157
+ - Debian (Linux)
158
+
159
+ Supported Deployment Engines:
160
+ - Tomcat 8
161
+ - Glassfish
162
+ - Resin
163
+ END
164
+ fi
158
165
exit 1
159
166
}
160
167
@@ -920,8 +927,9 @@ UpdateDescriptionCache()
920
927
921
928
OpenGrokUsage ()
922
929
{
930
+ [ " $1 " == " --detailed" ] && helpargs=$1
923
931
echo " Options for opengrok.jar:" 1>&2
924
- ${DO} ${JAVA} ${JAVA_OPTS} -jar " ${OPENGROK_JAR} " ' -?'
932
+ ${DO} ${JAVA} ${JAVA_OPTS} -jar " ${OPENGROK_JAR} " ' -?' $helpargs
925
933
}
926
934
927
935
DeployWar ()
@@ -1108,8 +1116,8 @@ case "${1}" in
1108
1116
;;
1109
1117
1110
1118
usage|help)
1111
- OpenGrokUsage
1112
- Usage
1119
+ OpenGrokUsage $2
1120
+ Usage $2
1113
1121
;;
1114
1122
* )
1115
1123
Usage
0 commit comments