Refactor the Bazel scripts.

Change-Id: Iab32c5bd319e7af527dca4736b10330ca2e8bc8c
Reviewed-on: https://code-review.googlesource.com/c/37950
Reviewed-by: Paul Wankadia <junyer@google.com>
diff --git a/kokoro/windows-bazel.sh b/kokoro/bazel.sh
similarity index 100%
rename from kokoro/windows-bazel.sh
rename to kokoro/bazel.sh
diff --git a/kokoro/macos-bazel.sh b/kokoro/macos-bazel.sh
index 6f25982..e43c852 100755
--- a/kokoro/macos-bazel.sh
+++ b/kokoro/macos-bazel.sh
@@ -1,26 +1,4 @@
 #!/bin/bash
 set -eux
-
-cd git/re2
-
-bazel clean
-bazel build --compilation_mode=dbg -- //...
-bazel test  --compilation_mode=dbg --test_output=errors -- //... \
-  -//:dfa_test \
-  -//:exhaustive1_test \
-  -//:exhaustive2_test \
-  -//:exhaustive3_test \
-  -//:exhaustive_test \
-  -//:random_test
-
-bazel clean
-bazel build --compilation_mode=opt -- //...
-bazel test  --compilation_mode=opt --test_output=errors -- //... \
-  -//:dfa_test \
-  -//:exhaustive1_test \
-  -//:exhaustive2_test \
-  -//:exhaustive3_test \
-  -//:exhaustive_test \
-  -//:random_test
-
-exit 0
+bash git/re2/kokoro/bazel.sh
+exit $?
diff --git a/kokoro/ubuntu-bazel.sh b/kokoro/ubuntu-bazel.sh
index 6f25982..e43c852 100755
--- a/kokoro/ubuntu-bazel.sh
+++ b/kokoro/ubuntu-bazel.sh
@@ -1,26 +1,4 @@
 #!/bin/bash
 set -eux
-
-cd git/re2
-
-bazel clean
-bazel build --compilation_mode=dbg -- //...
-bazel test  --compilation_mode=dbg --test_output=errors -- //... \
-  -//:dfa_test \
-  -//:exhaustive1_test \
-  -//:exhaustive2_test \
-  -//:exhaustive3_test \
-  -//:exhaustive_test \
-  -//:random_test
-
-bazel clean
-bazel build --compilation_mode=opt -- //...
-bazel test  --compilation_mode=opt --test_output=errors -- //... \
-  -//:dfa_test \
-  -//:exhaustive1_test \
-  -//:exhaustive2_test \
-  -//:exhaustive3_test \
-  -//:exhaustive_test \
-  -//:random_test
-
-exit 0
+bash git/re2/kokoro/bazel.sh
+exit $?
diff --git a/kokoro/windows-bazel.bat b/kokoro/windows-bazel.bat
index 7a7cefe..283f8d2 100755
--- a/kokoro/windows-bazel.bat
+++ b/kokoro/windows-bazel.bat
@@ -1,2 +1,2 @@
-bash git/re2/kokoro/windows-bazel.sh
+bash git/re2/kokoro/bazel.sh
 EXIT /B %ERRORLEVEL%