Skip to content

Commit 8f77a81

Browse files
committed
adapt Docker
1 parent 392613e commit 8f77a81

File tree

3 files changed

+21
-18
lines changed

3 files changed

+21
-18
lines changed

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ ENV CLASSPATH /usr/local/tomcat/bin/bootstrap.jar:/usr/local/tomcat/bin/tomcat-j
9696
COPY docker/logging.properties /usr/local/tomcat/conf/logging.properties
9797
RUN sed -i -e 's/Valve/Disabled/' /usr/local/tomcat/conf/server.xml
9898

99-
# add our scripts
99+
# add our scripts and configuration
100100
COPY docker /scripts
101101
RUN chmod -R +x /scripts
102102

docker/start.py

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@
7676
OPENGROK_JAR = os.path.join(OPENGROK_LIB_DIR, 'opengrok.jar')
7777

7878
NOMIRROR_ENV_NAME = 'NOMIRROR'
79+
API_TIMEOUT_ENV_NAME = 'API_TIMEOUT'
7980

8081
expected_token = None
8182
periodic_timer = None
@@ -481,16 +482,16 @@ def main():
481482
setup_redirect_source(logger, url_root)
482483

483484
api_timeout = 8
484-
if os.environ.get('API_TIMEOUT'):
485-
api_timeout = int(os.environ.get('API_TIMEOUT'))
486-
extra_indexer_options = "--connectTimeout " + str(api_timeout)
485+
if os.environ.get(API_TIMEOUT_ENV_NAME):
486+
api_timeout = int(os.environ.get(API_TIMEOUT_ENV_NAME))
487+
else:
488+
os.environ[API_TIMEOUT_ENV_NAME] = str(api_timeout)
487489

488490
env = {}
489-
indexer_opt = os.environ.get('INDEXER_OPT', '')
490-
if indexer_opt:
491-
extra_indexer_options += " " + indexer_opt
492-
logger.info("extra indexer options: '{}'".format(extra_indexer_options))
493-
env['OPENGROK_INDEXER_OPTIONAL_ARGS'] = extra_indexer_options
491+
extra_indexer_options = os.environ.get('INDEXER_OPT', '')
492+
if extra_indexer_options:
493+
logger.info("extra indexer options: '{}'".format(extra_indexer_options))
494+
env['OPENGROK_INDEXER_OPTIONAL_ARGS'] = extra_indexer_options
494495

495496
if os.environ.get(NOMIRROR_ENV_NAME):
496497
env[OPENGROK_NO_MIRROR_ENV] = os.environ.get(NOMIRROR_ENV_NAME)

docker/sync.yml

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,17 @@ commands:
77
duration: PT1H
88
tags: ['%PROJECT%']
99
text: resync + reindex in progress
10-
- command: [opengrok-mirror, -c, '/opengrok/etc/mirror.yml', -I, -U, '%URL%', '%PROJECT%']
11-
- command: [opengrok-reindex-project, --printoutput,
12-
--api_timeout, '%API_TIMEOUT',
13-
--jar, /opengrok/lib/opengrok.jar, -U, '%URL%', -P, '%PROJECT%', --,
14-
--connectTimeout, '%API_TIMEOUT',
15-
-r, dirbased, -G, -m, '256', --leadingWildCards, 'on',
16-
-c, /usr/local/bin/ctags, -U, '%URL%', -H, '%PROJECT%']
17-
limits: {RLIMIT_NOFILE: 1024}
18-
args_subst: {"%API_TIMEOUT%": $API_TIMEOUT}
10+
- command:
11+
args: [opengrok-mirror, -c, '/opengrok/etc/mirror.yml', -I, -U, '%URL%', '%PROJECT%']
12+
- command:
13+
args: [opengrok-reindex-project, --printoutput,
14+
--api_timeout, '%API_TIMEOUT%',
15+
--jar, /opengrok/lib/opengrok.jar, -U, '%URL%', -P, '%PROJECT%', --,
16+
--connectTimeout, '%API_TIMEOUT%',
17+
-r, dirbased, -G, -m, '256', --leadingWildCards, 'on',
18+
-c, /usr/local/bin/ctags, -U, '%URL%', -H, '%PROJECT%']
19+
limits: {RLIMIT_NOFILE: 1024}
20+
args_subst: {"%API_TIMEOUT%": "$API_TIMEOUT"}
1921
- call:
2022
uri: '%URL%api/v1/messages?tag=%PROJECT%'
2123
method: DELETE

0 commit comments

Comments
 (0)