summaryrefslogtreecommitdiffhomepage
path: root/tools/run_build.sh
diff options
context:
space:
mode:
authorAdin Scannell <ascannell@google.com>2019-06-04 14:42:25 -0700
committerShentubot <shentubot@google.com>2019-06-04 14:43:24 -0700
commit6f92038ce0d2062c3dfd84fe65141ee09deeabfc (patch)
treee15e97cb778178ff67b44c8196b426fe8e3a1da4 /tools/run_build.sh
parent0c292cdaab5c226bcf90c3376a0f3942cb266eed (diff)
Use github directory if it exists.
Unfortunately, kokoro names the top-level directory per the SCM type. This means there's no way to make the job names match; we simply need to probe for the existence of the correct directory. PiperOrigin-RevId: 251519409
Diffstat (limited to 'tools/run_build.sh')
-rwxr-xr-xtools/run_build.sh8
1 files changed, 5 insertions, 3 deletions
diff --git a/tools/run_build.sh b/tools/run_build.sh
index b6b446690..d49a1d4be 100755
--- a/tools/run_build.sh
+++ b/tools/run_build.sh
@@ -23,9 +23,11 @@ set -x
(which use_bazel.sh && use_bazel.sh latest) || which bazel
bazel version
-# Switch into the workspace and checkout the appropriate commit.
-if [[ -v KOKORO_GIT_COMMIT ]]; then
- cd git/repo && git checkout "${KOKORO_GIT_COMMIT}"
+# Switch into the workspace.
+if [[ -v KOKORO_GIT_COMMIT ]] && [[ -d git/repo ]]; then
+ cd git/repo
+elif [[ -v KOKORO_GIT_COMMIT ]] && [[ -d github/repo ]]; then
+ cd github/repo
fi
# Build runsc.