Expose debug ports in Gerrit
Exposing debug ports can be useful to connect your IDE
to the Gerrit process when investigting issues.
Change-Id: I8c20fbbc737504d0280eeed55b41c58e41f7aee0
diff --git a/example-setup/configs/gerrit.config.template b/example-setup/configs/gerrit.config.template
index 8bc8391..db97a37 100644
--- a/example-setup/configs/gerrit.config.template
+++ b/example-setup/configs/gerrit.config.template
@@ -6,6 +6,7 @@
[container]
javaOptions = "-Dflogger.backend_factory=com.google.common.flogger.backend.log4j.Log4jBackendFactory#getInstance"
javaOptions = "-Dflogger.logging_context=com.google.gerrit.server.logging.LoggingContext#getInstance"
+ javaOptions = "-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:$DEBUG_PORT"
replica = $REPLICA
[index]
type = LUCENE
diff --git a/example-setup/docker-compose.yaml b/example-setup/docker-compose.yaml
index b36f426..af90341 100644
--- a/example-setup/docker-compose.yaml
+++ b/example-setup/docker-compose.yaml
@@ -7,9 +7,11 @@
- REPLICA=false
- REMOTE=replica-1
- REMOTE_URL=gerrit2
+ - DEBUG_PORT=5005
ports:
- "8080:8080"
- "29418:29418"
+ - "5005:5005"
gerrit2:
build: .
environment:
@@ -17,8 +19,10 @@
- REPLICA=true
- REMOTE=primary
- REMOTE_URL=gerrit1
+ - DEBUG_PORT=5006
ports:
- "8081:8080"
- "29419:29418"
+ - "5006:5006"
depends_on:
- - gerrit1
\ No newline at end of file
+ - gerrit1