Dry out common Bazel options

Change-Id: I1623a25fd6615738105f0095890487cf87d6bb79
diff --git a/jenkins/gerrit-bazel-build.sh b/jenkins/gerrit-bazel-build.sh
index 51f8b41..0c17ff1 100644
--- a/jenkins/gerrit-bazel-build.sh
+++ b/jenkins/gerrit-bazel-build.sh
@@ -5,9 +5,12 @@
   cd gerrit
   . set-java.sh 8
 
-  bazel build --ignore_unsupported_sandboxing  \
+  export BAZEL_OPTS=--ignore_unsupported_sandboxing
+
+  bazel build $BAZEL_OPTS \
         gerrit-plugin-api:plugin-api_deploy.jar \
         gerrit-extension-api:extension-api_deploy.jar
-  bazel build --ignore_unsupported_sandboxing plugins:core
-  bazel build --ignore_unsupported_sandboxing release
+
+  bazel build $BAZEL_OPTS plugins:core
+  bazel build $BAZEL_OPTS release
 fi
diff --git a/jenkins/gerrit-bazel-test.sh b/jenkins/gerrit-bazel-test.sh
index eae4ea8..4de710c 100644
--- a/jenkins/gerrit-bazel-test.sh
+++ b/jenkins/gerrit-bazel-test.sh
@@ -4,18 +4,17 @@
 then
   cd gerrit
 
+  export BAZEL_OPTS="--ignore_unsupported_sandboxing --test_output errors \
+                     --test_summary detailed --flaky_test_attempts 3 \
+                     --test_verbose_timeout_warnings --build_tests_only" 
+
   echo 'Test in default DB mode'
   echo '----------------------------------------------'
-  bazel test --ignore_unsupported_sandboxing --test_output errors \
-             --test_summary detailed --flaky_test_attempts 3 \
-             --test_verbose_timeout_warnings --build_tests_only //...
+  bazel test $BAZEL_OPTS //...
 
   echo 'Test in Note DB mode'
   echo '----------------------------------------------'
-  GERRIT_ENABLE_NOTEDB=TRUE bazel test --ignore_unsupported_sandboxing \
-             --test_output errors --test_summary detailed \
-             --flaky_test_attempts 3 --test_verbose_timeout_warnings \
-             --build_tests_only //...
+  GERRIT_ENABLE_NOTEDB=TRUE bazel test $BAZEL_OPTS //...
 fi
 
 exit 0