Adapt local environment to events-gcloud-pubsub

The gcloud-pubsub-events plugin was originally hosted in GerritHub[1],
and then moved to gerrit-review[2] with the name of
'events-gcloud-pubsub'.

Adapt the local environment to use the events-gcloud-pubsub plugin.

[1]https://review.gerrithub.io/admin/repos/GerritForge/gcloud-pubsub-events
[2]https://gerrit-review.googlesource.com/admin/repos/plugins/events-gcloud-pubsub

Bug: Issue 14418
Change-Id: I3caf890c719adf3d2f662f4e31b13042165432a7
diff --git a/setup_local_env/configs/gerrit.config b/setup_local_env/configs/gerrit.config
index 02c3c45..368f94d 100644
--- a/setup_local_env/configs/gerrit.config
+++ b/setup_local_env/configs/gerrit.config
@@ -57,7 +57,7 @@
     endpoint = http://localhost:$BROKER_PORT
     applicationName = $GROUP_ID
     initialPosition = trim_horizon
-[plugin "gcloud-pubsub-events"]
+[plugin "events-gcloud-pubsub"]
     numberOfSubscribers = 6
     gcloudProject="test-project"
     subscriptionId=$GROUP_ID
diff --git a/setup_local_env/setup.sh b/setup_local_env/setup.sh
index 4b0ddb6..a0a32ee 100755
--- a/setup_local_env/setup.sh
+++ b/setup_local_env/setup.sh
@@ -449,9 +449,9 @@
 
 
 if [ "$BROKER_TYPE" = "gcloud-pubsub" ]; then
-echo "Downloading gcloud-pubsub-events plugin master (TODO: replace with $GERRIT_BRANCH, once we have build)"
-  wget $GERRIT_CI/plugin-gcloud-pubsub-events-gh-bazel-master-stable-3.3/$LAST_BUILD/gcloud-pubsub-events/gcloud-pubsub-events.jar \
-  -O $DEPLOYMENT_LOCATION/gcloud-pubsub-events.jar || { echo >&2 "Cannot download gcloud-pubsub-events plugin: Check internet connection. Abort\
+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 || { echo >&2 "Cannot download events-gcloud-pubsub plugin: Check internet connection. Abort\
 ing"; exit 1; }
 fi
 
@@ -508,6 +508,8 @@
   echo "Copy $BROKER_TYPE events plugin"
   if [ $BROKER_TYPE = "kinesis" ]; then
      cp -f $DEPLOYMENT_LOCATION/events-aws-kinesis.jar $LOCATION_TEST_SITE_1/plugins/events-aws-kinesis.jar
+  elif [ $BROKER_TYPE = "gcloud-pubsub" ]; then
+    cp -f $DEPLOYMENT_LOCATION/events-gcloud-pubsub.jar $LOCATION_TEST_SITE_1/plugins/events-gcloud-pubsub.jar
   else
      cp -f $DEPLOYMENT_LOCATION/$BROKER_TYPE-events.jar $LOCATION_TEST_SITE_1/plugins/$BROKER_TYPE-events.jar
   fi