Merge branch 'stable-3.1'

* stable-3.1:
  Use load-balancer service ports from HAProxy
  Fix dual-master recipe: add  missing template parameters
  Fix dual-master recipe adding missing parameter HTTPGerritMaster2Port
  Base all image paths on the project ROOT_DIR
  Fix SHA1 computation for haproxy / syslog-sidecar
  Add missing LB_SUBDOMAIN for dual-master config
  Add healthcheck plugin
  Fix Gerrit root directory
  Remove .empty file
  Add HAProxy in front of the dual masters
  Fix Gerrit sha1 calculation
  Remove auth section duplicate

Change-Id: I31953d155de52acbafc3badfe1da599d18debeb6
diff --git a/common.env b/common.env
index 6567028..be6480b 100644
--- a/common.env
+++ b/common.env
@@ -4,8 +4,8 @@
 CLUSTER_KEYS=$(AWS_PREFIX)-cluster-keys
 
 # Gerrit version
-GERRIT_VERSION=3.1
-GERRIT_PATCH=4
+GERRIT_VERSION=3.2
+GERRIT_PATCH=0-rc3
 GERRIT_BRANCH=stable-$(GERRIT_VERSION)
 
 # Gerrit CI
diff --git a/gerrit/Dockerfile b/gerrit/Dockerfile
index 5586696..aa03945 100644
--- a/gerrit/Dockerfile
+++ b/gerrit/Dockerfile
@@ -1,9 +1,8 @@
-FROM gerritcodereview/gerrit:$GERRIT_VERSION.$GERRIT_PATCH-centos7
+FROM gerritcodereview/gerrit:$GERRIT_VERSION.$GERRIT_PATCH-centos8
 
 USER root
 
-RUN yum install -y https://repo.ius.io/ius-release-el7.rpm \
-    && yum install -y python36u python36u-libs python36u-devel python36u-pip
+RUN  yum install -y python36 python3-libs python36-devel python3-pip
 
 COPY --chown=gerrit:gerrit ssh-config /var/gerrit/.ssh/config
 
diff --git a/gerrit/Makefile b/gerrit/Makefile
index 902e93a..a6d6719 100644
--- a/gerrit/Makefile
+++ b/gerrit/Makefile
@@ -15,12 +15,12 @@
 	|| { echo >&2 "Cannot download metrics-reporter-prometheus plugin: Check internet connection. Aborting"; exit 1; }
 
 	@echo "Downloading javamelody plugin $(GERRIT_BRANCH)"
-	wget $(GERRIT_CI)/plugin-javamelody-bazel-$(GERRIT_BRANCH)/$(LAST_BUILD)/javamelody/javamelody.jar \
+	wget $(GERRIT_CI)/plugin-javamelody-bazel-master-$(GERRIT_BRANCH)/$(LAST_BUILD)/javamelody/javamelody.jar \
 	-O ./plugins/javamelody.jar \
 	|| { echo >&2 "Cannot download javamelody plugin: Check internet connection. Aborting"; exit 1; }
 
 	@echo "Downloading HA plugin $(GERRIT_BRANCH)"
-	wget $(GERRIT_CI)/plugin-high-availability-bazel-$(GERRIT_BRANCH)/$(LAST_BUILD)/high-availability/high-availability.jar \
+	wget $(GERRIT_CI)/plugin-high-availability-bazel-master-$(GERRIT_BRANCH)/$(LAST_BUILD)/high-availability/high-availability.jar \
 	-O ./plugins/high-availability.jar \
 	|| { echo >&2 "Cannot download high-availability plugin: Check internet connection. Aborting"; exit 1; }
 
diff --git a/gerrit/entrypoint.sh b/gerrit/entrypoint.sh
index da968e9..5b76d4f 100755
--- a/gerrit/entrypoint.sh
+++ b/gerrit/entrypoint.sh
@@ -12,6 +12,7 @@
   java -jar /var/gerrit/bin/gerrit.war reindex -d /var/gerrit
 else
   java -jar /var/gerrit/bin/gerrit.war init --no-auto-start --batch --install-all-plugins -d /var/gerrit
+  java -jar /var/gerrit/bin/gerrit.war reindex --index projects -d /var/gerrit
 fi
 
 echo "Running Gerrit ..."