Merge "Merge branch 'stable-3.8'"
diff --git a/setup_local_env/setup.sh b/setup_local_env/setup.sh
index a55feb7..32880a2 100755
--- a/setup_local_env/setup.sh
+++ b/setup_local_env/setup.sh
@@ -19,8 +19,6 @@
GERRIT_BRANCH=stable-3.8
GERRIT_CI=https://gerrit-ci.gerritforge.com/view/Plugins-$GERRIT_BRANCH/job
LAST_BUILD=lastSuccessfulBuild/artifact/bazel-bin/plugins
-EVENTS_BROKER_VER=`grep 'com.gerritforge:events-broker' $(dirname $0)/../external_plugin_deps.bzl | cut -d '"' -f 2 | cut -d ':' -f 3`
-GLOBAL_REFDB_VER=`grep 'com.gerritforge:global-refdb' $(dirname $0)/../external_plugin_deps.bzl | cut -d '"' -f 2 | cut -d ':' -f 3`
function check_application_requirements {
type haproxy >/dev/null 2>&1 || { echo >&2 "Require haproxy but it's not installed. Aborting."; exit 1; }
@@ -226,6 +224,16 @@
fi
}
+function download_artifact_from_ci {
+ local artifact_name=$1
+ local prefix=${2:-plugin}
+ wget $GERRIT_CI/$prefix-$artifact_name-bazel-$GERRIT_BRANCH/$LAST_BUILD/$artifact_name/$artifact_name.jar \
+ -O $DEPLOYMENT_LOCATION/$artifact_name.jar || \
+ wget $GERRIT_CI/$prefix-$artifact_name-bazel-master-$GERRIT_BRANCH/$LAST_BUILD/$artifact_name/$artifact_name.jar \
+ -O $DEPLOYMENT_LOCATION/$artifact_name.jar || \
+ { echo >&2 "Cannot download $artifact_name $prefix: Check internet connection. Aborting"; exit 1; }
+}
+
while [ $# -ne 0 ]
do
case "$1" in
@@ -411,80 +419,43 @@
fi
if [ $DOWNLOAD_WEBSESSION_PLUGIN = "true" ];then
echo "Downloading websession-broker plugin $GERRIT_BRANCH"
- wget $GERRIT_CI/plugin-websession-broker-bazel-$GERRIT_BRANCH/$LAST_BUILD/websession-broker/websession-broker.jar \
- -O $DEPLOYMENT_LOCATION/websession-broker.jar || \
- wget $GERRIT_CI/plugin-websession-broker-bazel-master-$GERRIT_BRANCH/$LAST_BUILD/websession-broker/websession-broker.jar \
- -O $DEPLOYMENT_LOCATION/websession-broker.jar || \
- { echo >&2 "Cannot download websession-broker plugin: Check internet connection. Abort\
-ing"; exit 1; }
- wget $GERRIT_CI/plugin-healthcheck-bazel-$GERRIT_BRANCH/$LAST_BUILD/healthcheck/healthcheck.jar \
- -O $DEPLOYMENT_LOCATION/healthcheck.jar || { echo >&2 "Cannot download healthcheck plugin: Check internet connection. Abort\
-ing"; exit 1; }
+ download_artifact_from_ci websession-broker
+ download_artifact_from_ci healthcheck
+
else
echo "Without the websession-broker; user login via haproxy will fail."
fi
echo "Downloading zookeeper plugin $GERRIT_BRANCH"
- wget $GERRIT_CI/plugin-zookeeper-refdb-bazel-$GERRIT_BRANCH/$LAST_BUILD/zookeeper-refdb/zookeeper-refdb.jar \
- -O $DEPLOYMENT_LOCATION/zookeeper-refdb.jar || \
- wget $GERRIT_CI/plugin-zookeeper-refdb-bazel-master-$GERRIT_BRANCH/$LAST_BUILD/zookeeper-refdb/zookeeper-refdb.jar \
- -O $DEPLOYMENT_LOCATION/zookeeper-refdb.jar || \
- { echo >&2 "Cannot download zookeeper plugin: Check internet connection. Abort\
-ing"; exit 1; }
+ download_artifact_from_ci zookeeper-refdb
echo "Downloading global-refdb library $GERRIT_BRANCH"
- wget https://repo1.maven.org/maven2/com/gerritforge/global-refdb/$GLOBAL_REFDB_VER/global-refdb-$GLOBAL_REFDB_VER.jar \
- -O $DEPLOYMENT_LOCATION/global-refdb.jar || { echo >&2 "Cannot download global-refdb library: Check internet connection. Abort\
-ing"; exit 1; }
+ download_artifact_from_ci global-refdb "module"
echo "Downloading events-broker library $GERRIT_BRANCH"
- wget https://repo1.maven.org/maven2/com/gerritforge/events-broker/$EVENTS_BROKER_VER/events-broker-$EVENTS_BROKER_VER.jar \
- -O $DEPLOYMENT_LOCATION/events-broker.jar || { echo >&2 "Cannot download events-broker library: Check internet connection. Abort\
-ing"; exit 1; }
+ download_artifact_from_ci events-broker "module"
if [ "$BROKER_TYPE" = "kafka" ]; then
echo "Downloading events-kafka plugin $GERRIT_BRANCH"
- wget $GERRIT_CI/plugin-events-kafka-bazel-$GERRIT_BRANCH/$LAST_BUILD/events-kafka/events-kafka.jar \
- -O $DEPLOYMENT_LOCATION/events-kafka.jar || \
- wget $GERRIT_CI/plugin-events-kafka-bazel-master-$GERRIT_BRANCH/$LAST_BUILD/events-kafka/events-kafka.jar \
- -O $DEPLOYMENT_LOCATION/events-kafka.jar || \
- { echo >&2 "Cannot download events-kafka plugin: Check internet connection. Abort\
-ing"; exit 1; }
+ download_artifact_from_ci events-kafka
fi
if [ "$BROKER_TYPE" = "kinesis" ]; then
echo "Downloading events-aws-kinesis plugin $GERRIT_BRANCH"
- wget $GERRIT_CI/plugin-events-aws-kinesis-bazel-$GERRIT_BRANCH/$LAST_BUILD/events-aws-kinesis/events-aws-kinesis.jar \
- -O $DEPLOYMENT_LOCATION/events-aws-kinesis.jar || \
- wget $GERRIT_CI/plugin-events-aws-kinesis-bazel-master-$GERRIT_BRANCH/$LAST_BUILD/events-aws-kinesis/events-aws-kinesis.jar \
- -O $DEPLOYMENT_LOCATION/events-aws-kinesis.jar || \
- { echo >&2 "Cannot download events-aws-kinesis plugin: Check internet connection. Abort\
-ing"; exit 1; }
+ download_artifact_from_ci events-aws-kinesis
fi
if [ "$BROKER_TYPE" = "gcloud-pubsub" ]; then
echo "Downloading events-gcloud-pubsub plugin $GERRIT_BRANCH"
- wget $GERRIT_CI/plugin-events-gcloud-pubsub-bazel-$GERRIT_BRANCH/$LAST_BUILD/events-gcloud-pubsub/events-gcloud-pubsub.jar \
- -O $DEPLOYMENT_LOCATION/events-gcloud-pubsub.jar || \
- wget $GERRIT_CI/plugin-events-gcloud-pubsub-bazel-master-$GERRIT_BRANCH/$LAST_BUILD/events-gcloud-pubsub/events-gcloud-pubsub.jar \
- -O $DEPLOYMENT_LOCATION/events-gcloud-pubsub.jar || \
- { echo >&2 "Cannot download events-gcloud-pubsub plugin: Check internet connection. Abort\
-ing"; exit 1; }
+ download_artifact_from_ci events-gcloud-pubsub
fi
echo "Downloading metrics-reporter-prometheus plugin $GERRIT_BRANCH"
- wget $GERRIT_CI/plugin-metrics-reporter-prometheus-bazel-$GERRIT_BRANCH/$LAST_BUILD/metrics-reporter-prometheus/metrics-reporter-prometheus.jar \
- -O $DEPLOYMENT_LOCATION/metrics-reporter-prometheus.jar || \
- wget $GERRIT_CI/plugin-metrics-reporter-prometheus-bazel-master-$GERRIT_BRANCH/$LAST_BUILD/metrics-reporter-prometheus/metrics-reporter-prometheus.jar \
- -O $DEPLOYMENT_LOCATION/metrics-reporter-prometheus.jar || \
- { echo >&2 "Cannot download metrics-reporter-prometheus plugin: Check internet connection. Abort\
-ing"; exit 1; }
+ download_artifact_from_ci metrics-reporter-prometheus
echo "Downloading pull-replication plugin $GERRIT_BRANCH"
- wget $GERRIT_CI/plugin-pull-replication-bazel-$GERRIT_BRANCH/$LAST_BUILD/pull-replication/pull-replication.jar \
- -O $DEPLOYMENT_LOCATION/pull-replication.jar || { echo >&2 "Cannot download pull-replication plugin: Check internet connection. Abort\
-ing"; exit 1; }
+ download_artifact_from_ci pull-replication
if [ "$HTTPS_ENABLED" = "true" ];then
export HTTP_PROTOCOL="https"