Skip to content

Commit 0427f67

Browse files
committed
add INFRABOX_GERRIT_CLONE_PORT
1 parent 8705bfc commit 0427f67

3 files changed

Lines changed: 9 additions & 5 deletions

File tree

deploy/infrabox/templates/_helpers.tpl

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,9 @@ https://{{- required "host is required" .Values.host -}}:{{- .Values.port -}}
280280
-
281281
name: INFRABOX_GERRIT_PORT
282282
value: {{ default "29418" .Values.gerrit.port | quote }}
283+
-
284+
name: INFRABOX_GERRIT_CLONE_PORT
285+
value: {{ default "39418" .Values.gerrit.clone_port | quote }}
283286
{{ end }}
284287
{{ end }}
285288

@@ -561,4 +564,4 @@ https://{{- .Values.ha.global_host -}}:{{- .Values.ha.global_port -}}
561564
hostPath:
562565
path: {{ .Values.dev.repo_path }}
563566
{{ end }}
564-
{{ end }}
567+
{{ end }}

deploy/infrabox/values.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,9 @@ gerrit:
204204
# Port
205205
port: 29418
206206

207+
# Clone Port
208+
clone_port: 39418
209+
207210
# Github configuration
208211
github:
209212
# Enable Github

src/gerrit/trigger/trigger.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,10 @@ def main():
4040

4141
logger.info("Connected to gerrit")
4242
_, stdout, _ = client.exec_command('gerrit stream-events')
43-
logger.info(f"stdout is: {stdout}")
4443
logger.info("Waiting for stream-events")
4544
for line in stdout:
46-
logger.info(f"line -1 is: {line}")
4745
for i in range(0, 2):
4846
try:
49-
logger.info(f"line {i} is: {line}")
5047
event = json.loads(line)
5148
if event['type'] in ("patchset-created", "draft-published", "change-merged"):
5249
logger.debug(json.dumps(event, indent=4))
@@ -193,6 +190,7 @@ def handle_patchset_created_project(conn, event, project_id, project_name):
193190
"GERRIT_TOPIC": event['change'].get('topic', ""),
194191
"GERRIT_HOST": get_env('INFRABOX_GERRIT_HOSTNAME'),
195192
"GERRIT_PORT": get_env('INFRABOX_GERRIT_PORT'),
193+
"GERRIT_CLONE_PORT": get_env('INFRABOX_GERRIT_CLONE_PORT'),
196194
}
197195

198196
if event.get('uploader', None):
@@ -210,7 +208,7 @@ def handle_patchset_created_project(conn, event, project_id, project_name):
210208
"commit": sha,
211209
"clone_url": "ssh://%s@%s:%s/%s" % (get_env('INFRABOX_GERRIT_USERNAME'),
212210
get_env('INFRABOX_GERRIT_HOSTNAME'),
213-
get_env('INFRABOX_GERRIT_PORT'),
211+
get_env('INFRABOX_GERRIT_CLONE_PORT'),
214212
project_name),
215213
"ref": event['patchSet']['ref'],
216214
"event": event['change']['branch']

0 commit comments

Comments
 (0)