Bump to Gerrit v2.14 and Java 1.8

Gerrit v2.14 packaging will include as well the plugin-manager
which will allow the admin to setup additional plugins as
first action after login.

Change-Id: I6e8464852a91a312c5de175751c9c102b0fa1f30
diff --git a/docker/centos7/Makefile b/docker/centos7/Makefile
index 703486b..9440178 100644
--- a/docker/centos7/Makefile
+++ b/docker/centos7/Makefile
@@ -1,7 +1,7 @@
 # Customise the following variable as Make parameters
 # to produce a yum.repo for a VENDOR distribution
 # Default values are pointing to GerritForge (www.gerritforge.com)
-VERSION=2.13.8
+VERSION=2.14
 RELEASE=1
 REPO_VERSION=1
 REPO_RELEASE=2
@@ -24,7 +24,7 @@
 
 # Install OpenJDK and Gerrit in two subsequent transactions
 # (pre-trans Gerrit script needs to have access to the Java command)
-RUN yum -y install java-1.7.0-openjdk
+RUN yum -y install java-1.8.0-openjdk
 RUN yum -y install gerrit-$(VERSION)-$(RELEASE)
 
 USER gerrit
diff --git a/docker/ubuntu15.04/Makefile b/docker/ubuntu15.04/Makefile
index 592af91..bd4fe85 100644
--- a/docker/ubuntu15.04/Makefile
+++ b/docker/ubuntu15.04/Makefile
@@ -1,7 +1,7 @@
 # Customise the following variable as Make parameters
 # to produce a yum.repo for a VENDOR distribution
 # Default values are pointing to GerritForge (www.gerritforge.com)
-VERSION=2.13.8
+VERSION=2.14
 RELEASE=1
 VENDOR=GerritForge
 VENDOR_LC=$(shell echo $(VENDOR) | tr A-Z a-z)
@@ -26,7 +26,7 @@
 
 # Install OpenJDK and Gerrit in two subsequent transactions
 # (pre-trans Gerrit script needs to have access to the Java command)
-RUN apt-get -y install openjdk-7-jdk
+RUN apt-get -y install openjdk-8-jdk
 RUN apt-get -y install gerrit=$(VERSION)-$(RELEASE)
 
 USER gerrit
diff --git a/fpm/Makefile b/fpm/Makefile
index e420a9e..41b6725 100644
--- a/fpm/Makefile
+++ b/fpm/Makefile
@@ -1,6 +1,6 @@
-VERSION=2.13.8
+VERSION=2.14
 URL=https://gerrit-releases.storage.googleapis.com/gerrit-$(VERSION).war
-CI_URL=https://gerrit-ci.gerritforge.com/
+CI_URL=https://gerrit-ci.gerritforge.com
 RELEASE=1
 
 NAME=gerrit
@@ -22,7 +22,7 @@
 PLUGINS=plugin-manager
 PLUGINS_JARS=$(foreach PLUGIN,$(PLUGINS),$(PLUGIN).jar)
 PLUGINS_PATHS=$(foreach PLUGIN_JAR,$(PLUGINS_JARS),$(BUILD_ROOT)/plugins/$(PLUGIN_JAR))
-BRANCH=master
+BRANCH=stable-2.14
 
 RPM_OUT=$(OUT)/gerrit-$(VERSION)-$(RELEASE).$(BUILD_ARCH).rpm
 DEB_OUT=$(OUT)/gerrit-$(VERSION)-$(RELEASE).$(BUILD_ARCH).deb
@@ -85,7 +85,7 @@
 	curl -o $@  $(URL)
 
 $(BUILD_ROOT)/plugins/%.jar:
-	PLUGIN_NAME=`basename $@` && curl -o $@ $(CI_URL)/job/plugin-$$PLUGIN_NAME-$(BRANCH)/lastSuccessfulBuild/artifact/buck-out/gen/plugins/$$PLUGIN_NAME/$$PLUGIN_NAME.jar
+	PLUGIN_NAME=`basename $@ .jar` && curl -o $@ $(CI_URL)/job/plugin-$$PLUGIN_NAME-bazel-$(BRANCH)/lastSuccessfulBuild/artifact/bazel-genfiles/plugins/$$PLUGIN_NAME/$$PLUGIN_NAME.jar
 
 $(SCRIPTS_ROOT)/%.sh: scripts/%.sh
 	echo "#!/bin/bash" > $@
diff --git a/fpm/etc/gerrit.config b/fpm/etc/gerrit.config
index d111195..c3586ec 100644
--- a/fpm/etc/gerrit.config
+++ b/fpm/etc/gerrit.config
@@ -15,3 +15,5 @@
 	listenUrl = http://*:8080/
 [cache]
 	directory = cache
+[plugins]
+	allowRemoteAdmin = true
diff --git a/fpm/scripts/before-install.sh b/fpm/scripts/before-install.sh
index 8c14336..ab5a0f6 100755
--- a/fpm/scripts/before-install.sh
+++ b/fpm/scripts/before-install.sh
@@ -23,11 +23,11 @@
 
 echo -n "Checking Java version ... "
 JAVA_VERSION=$(java -version 2>&1)
-[ $? != 0 ] && echo -e "NOT FOUND\nPlease install Java >= 1.7.0 and try again" && exit 2
+[ $? != 0 ] && echo -e "NOT FOUND\nPlease install Java >= 1.8.0 and try again" && exit 2
 
 VERSION=`expr "$JAVA_VERSION" : '.*"\(1.[0-9\.]*\)["_]'`
 echo "$VERSION"
-test "$VERSION" "<" "1.7" && echo "ERROR: java >= 1.7.0 required by Gerrit" && exit 3
+test "$VERSION" "<" "1.8" && echo "ERROR: java >= 1.8.0 required by Gerrit" && exit 3
 
 # Script is invoked even before upgrade, we need to stop Gerrit if active
 if [ -e /etc/init.d/gerrit ]
diff --git a/macOS/Makefile b/macOS/Makefile
index d94ee84..884e862 100644
--- a/macOS/Makefile
+++ b/macOS/Makefile
@@ -1,4 +1,4 @@
-VERSION := 2.13.8
+VERSION := 2.14
 
 all: server
 
diff --git a/macOS/README.md b/macOS/README.md
index bb9bc00..6c49d6d 100644
--- a/macOS/README.md
+++ b/macOS/README.md
@@ -8,5 +8,5 @@
 ```
   $ chmod a+x scripts/*
   $ chmod a+x uninstaller/scripts/*
-  $ make VERSION=2.13.7
+  $ make
 ```