Merge branch 'stable-3.1'

* stable-3.1:
  Don't wait for the slave to be ready to create master
  Reindex when spinning up second master
  Set Gerrit to 3.1.5
  Add Gerrit slave to dual-master recipe
  Fixed init phase in entrypoint script
  Publish images when creating whole stack
  Only define cookiedomain if defined

Change-Id: I5b327f53914280c42ec32850e9f4bd5ad3c4dd6f
diff --git a/common.env b/common.env
index d078757..e7f2eeb 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=5
+GERRIT_VERSION=3.2
+GERRIT_PATCH=0-rc4
 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; }