tree: 4d3c329d8d6d586b86a760934cdeaf2e1e5de8fc [path history] [tgz]
  1. configs/
  2. haproxy-config/
  3. prometheus-config/
  4. docker-compose-core.yaml
  5. docker-compose-gcloud-pubsub.yaml
  6. docker-compose-kafka.yaml
  7. docker-compose-kinesis.yaml

Local environment setup

This script configures a full environment to simulate a Gerrit Multi-Site setup. The environment is composed by:

  • 2 gerrit instances deployed by default in /tmp
  • 1 zookeeper node
  • 1 Broker node (kafka, kinesis or gcloud-pubsub)
  • 1 HA-PROXY


  • java
  • docker and docker-compose
  • wget
  • envsubst
  • haproxy
  • aws-cli (only when broker_type is “kinesis”)


Simplest setup with all default values and cleanup previous deployment. This will deploy kafka broker

sh setup_local_env/ --release-war-file /path/to/gerrit.war --multisite-lib-file /path/to/multi-site.jar

Deploy Kinesis broker

sh setup_local_env/ \
    --release-war-file /path/to/gerrit.war \
    --multisite-lib-file /path/to/multi-site.jar \
    --broker-type kinesis

Deploy GCloud PubSub broker

sh setup_local_env/ \
    --release-war-file /path/to/gerrit.war \
    --multisite-lib-file /path/to/multi-site.jar \
    --broker-type gcloud-pubsub

Cleanup the previous deployments

sh setup_local_env/ --just-cleanup-env true


Usage: sh ./ [--option ]

[--release-war-file]            Location to release.war file
[--multisite-lib-file]          Location to lib multi-site.jar file

[--new-deployment]              Cleans up previous gerrit deployment and re-installs it. default true
[--get-websession-plugin]       Download websession-broker plugin from CI lastSuccessfulBuild; default true
[--deployment-location]         Base location for the test deployment; default /tmp

[--gerrit-canonical-host]       The default host for Gerrit to be accessed through; default localhost
[--gerrit-canonical-port]       The default port for Gerrit to be accessed throug; default 8080

[--gerrit-ssh-advertised-port]  Gerrit Instance 1 sshd port; default 29418

[--gerrit1-httpd-port]          Gerrit Instance 1 http port; default 18080
[--gerrit1-sshd-port]           Gerrit Instance 1 sshd port; default 39418

[--gerrit2-httpd-port]          Gerrit Instance 2 http port; default 18081
[--gerrit2-sshd-port]           Gerrit Instance 2 sshd port; default 49418

[--replication-type]            Options [file,ssh]; default ssh
[--replication-ssh-user]        SSH user for the replication plugin; default $(whoami)
[--replication-delay]           Replication delay across the two instances in seconds

[--just-cleanup-env]            Cleans up previous deployment; default false

[--enabled-https]               Enabled https; default true

[--broker_type]                 events broker type; 'kafka', 'kinesis' or 'gcloud-pubsub'. Default 'kafka'


  • Assumes the ssh replication is done always on port 22 on both instances
  • When cloning projects via ssh, public keys entries are added to known_hosts
    • Clean up the old entries when doing a new deployment, otherwise just use HTTP