chore: split systests into separate kokoro build (#833)

* chore: split systests into their own Kokoro build

Closes #832.

* chore: docs builds no longer need systest resource

* chore: remove hacks to get 'gcloud'/'gfile_resource' installed for docs
diff --git a/.kokoro/build-systests.sh b/.kokoro/build-systests.sh
new file mode 100755
index 0000000..a2947c2
--- /dev/null
+++ b/.kokoro/build-systests.sh
@@ -0,0 +1,48 @@
+#!/bin/bash
+# Copyright 2018 Google LLC
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     https://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+set -eo pipefail
+
+if [[ -z "${PROJECT_ROOT:-}" ]]; then
+    PROJECT_ROOT="github/google-auth-library-python"
+fi
+
+cd "${PROJECT_ROOT}"
+
+# Disable buffering, so that the logs stream through.
+export PYTHONUNBUFFERED=1
+
+# Remove old nox
+python3 -m pip uninstall --yes --quiet nox-automation
+
+# Install nox
+python3 -m pip install --upgrade --quiet nox
+python3 -m nox --version
+
+# Setup service account credentials.
+export GOOGLE_APPLICATION_CREDENTIALS=${KOKORO_GFILE_DIR}/service-account.json
+
+# Setup project id.
+export PROJECT_ID=$(cat "${KOKORO_GFILE_DIR}/project-id.txt")
+
+# Activate gcloud with service account credentials
+gcloud auth activate-service-account --key-file=$GOOGLE_APPLICATION_CREDENTIALS
+gcloud config set project ${PROJECT_ID}
+
+# Decrypt system test secrets
+./scripts/decrypt-secrets.sh
+
+# Run system tests which use a different noxfile
+python3 -m nox -f system_tests/noxfile.py
diff --git a/.kokoro/build.sh b/.kokoro/build.sh
index 1f96e21..04ab45c 100755
--- a/.kokoro/build.sh
+++ b/.kokoro/build.sh
@@ -24,22 +24,6 @@
 # Disable buffering, so that the logs stream through.
 export PYTHONUNBUFFERED=1
 
-# Debug: show build environment
-env | grep KOKORO
-
-# Setup service account credentials.
-export GOOGLE_APPLICATION_CREDENTIALS=${KOKORO_GFILE_DIR}/service-account.json
-
-# Setup project id.
-export PROJECT_ID=$(cat "${KOKORO_GFILE_DIR}/project-id.txt")
-
-# Activate gcloud with service account credentials	
-gcloud auth activate-service-account --key-file=$GOOGLE_APPLICATION_CREDENTIALS	
-gcloud config set project ${PROJECT_ID}	
-
-# Decrypt system test secrets	
-./scripts/decrypt-secrets.sh
-
 # Remove old nox
 python3 -m pip uninstall --yes --quiet nox-automation
 
@@ -54,10 +38,3 @@
 else
     python3 -m nox
 fi
-
-
-# Decrypt system test secrets
-./scripts/decrypt-secrets.sh
-
-# Run system tests which use a different noxfile
-python3 -m nox -f system_tests/noxfile.py
\ No newline at end of file
diff --git a/.kokoro/docker/docs/Dockerfile b/.kokoro/docker/docs/Dockerfile
index a6bcfc8..4e1b1fb 100644
--- a/.kokoro/docker/docs/Dockerfile
+++ b/.kokoro/docker/docs/Dockerfile
@@ -64,12 +64,4 @@
   && python3.8 /tmp/get-pip.py \
   && rm /tmp/get-pip.py
 
-# Install gcloud SDK
-RUN echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] http://packages.cloud.google.com/apt cloud-sdk main" | \
-    tee -a /etc/apt/sources.list.d/google-cloud-sdk.list \
-  && curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | \
-    apt-key --keyring /usr/share/keyrings/cloud.google.gpg  add - \
-  && apt-get update -y \
-  && apt-get install python2 google-cloud-sdk -y
-
 CMD ["python3.8"]
diff --git a/.kokoro/docs/common.cfg b/.kokoro/docs/common.cfg
index 2118d7d..24c8c89 100644
--- a/.kokoro/docs/common.cfg
+++ b/.kokoro/docs/common.cfg
@@ -10,9 +10,6 @@
 # Download trampoline resources.
 gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline"
 
-# Download resources for system tests (service account key, etc.)
-gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/google-auth-library-python"
-
 # Use the trampoline script to run in docker.
 build_file: "google-auth-library-python/.kokoro/trampoline_v2.sh"
 
@@ -65,4 +62,4 @@
       keyname: "docuploader_service_account"
     }
   }
-}
+}
\ No newline at end of file
diff --git a/.kokoro/presubmit/system-3.7.cfg b/.kokoro/presubmit/system-3.7.cfg
new file mode 100644
index 0000000..0393b98
--- /dev/null
+++ b/.kokoro/presubmit/system-3.7.cfg
@@ -0,0 +1,5 @@
+# Format: //devtools/kokoro/config/proto/build.proto
+env_vars: {
+    key: "TRAMPOLINE_BUILD_FILE"
+    value: "github/google-auth-library-python/.kokoro/build-systests.sh"
+}
diff --git a/owlbot.py b/owlbot.py
index fa03d69..58aa53a 100644
--- a/owlbot.py
+++ b/owlbot.py
@@ -13,7 +13,6 @@
     templated_files / ".kokoro",
     excludes=[
         "continuous/common.cfg",
-        "docs/common.cfg",
         "presubmit/common.cfg",
         "build.sh",
     ],
@@ -26,20 +25,4 @@
     'value: "docs"',
 )
 
-assert 1 == s.replace(
-    ".kokoro/docker/docs/Dockerfile",
-    """\
-CMD \["python3\.8"\]""",
-    """\
-# Install gcloud SDK
-RUN echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] http://packages.cloud.google.com/apt cloud-sdk main" | \\
-    tee -a /etc/apt/sources.list.d/google-cloud-sdk.list \\
-  && curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | \\
-    apt-key --keyring /usr/share/keyrings/cloud.google.gpg  add - \\
-  && apt-get update -y \\
-  && apt-get install python2 google-cloud-sdk -y
-
-CMD ["python3.8"]""",
-)
-
 s.shell.run(["nox", "-s", "blacken"], hide_output=False)