Skip to content

Commit bccda25

Browse files
committed
preparation for args substitution
1 parent 310c579 commit bccda25

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

docker/sync.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,13 @@ commands:
99
text: resync + reindex in progress
1010
- command: [opengrok-mirror, -c, '/opengrok/etc/mirror.yml', -I, -U, '%URL%', '%PROJECT%']
1111
- command: [opengrok-reindex-project, --printoutput,
12+
--api_timeout, '%API_TIMEOUT',
1213
--jar, /opengrok/lib/opengrok.jar, -U, '%URL%', -P, '%PROJECT%', --,
14+
--connectTimeout, '%API_TIMEOUT',
1315
-r, dirbased, -G, -m, '256', --leadingWildCards, 'on',
1416
-c, /usr/local/bin/ctags, -U, '%URL%', -H, '%PROJECT%']
1517
limits: {RLIMIT_NOFILE: 1024}
18+
args_subst: {"%API_TIMEOUT%": $API_TIMEOUT}
1619
- call:
1720
uri: '%URL%api/v1/messages?tag=%PROJECT%'
1821
method: DELETE

tools/src/main/python/opengrok_tools/utils/commandsequence.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ class CommandSequenceBase:
148148

149149
def __init__(self, name, commands, loglevel=logging.INFO, cleanup=None,
150150
driveon=False, url=None, env=None, http_headers=None,
151-
api_timeout=None, async_api_timeout=None):
151+
api_timeout=None, async_api_timeout=None, args_subst={}):
152152
self.name = name
153153

154154
if commands is None:
@@ -179,6 +179,10 @@ def __init__(self, name, commands, loglevel=logging.INFO, cleanup=None,
179179

180180
self.url = url
181181

182+
self.args_subst = {PROJECT_SUBST: self.name,
183+
URL_SUBST: self.url}
184+
self.args_subst.extend(args_subst)
185+
182186
def __str__(self):
183187
return str(self.name)
184188

@@ -263,8 +267,7 @@ def run(self):
263267
env_vars=command.get("env"),
264268
logger=self.logger,
265269
resource_limits=command.get("limits"),
266-
args_subst={PROJECT_SUBST: self.name,
267-
URL_SUBST: self.url},
270+
args_subst=self.args_subst,
268271
args_append=[self.name], excl_subst=True)
269272
ret_code = self.run_command(command)
270273

0 commit comments

Comments
 (0)