|
| 1 | +#!/bin/bash |
| 2 | +# Copyright 2018 Google LLC |
| 3 | +# |
| 4 | +# Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | +# you may not use this file except in compliance with the License. |
| 6 | +# You may obtain a copy of the License at |
| 7 | +# |
| 8 | +# https://www.apache.org/licenses/LICENSE-2.0 |
| 9 | +# |
| 10 | +# Unless required by applicable law or agreed to in writing, software |
| 11 | +# distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | +# See the License for the specific language governing permissions and |
| 14 | +# limitations under the License. |
| 15 | + |
| 16 | +set -eo pipefail |
| 17 | + |
| 18 | +cd github/python-aiplatform |
| 19 | + |
| 20 | +# Disable buffering, so that the logs stream through. |
| 21 | +export PYTHONUNBUFFERED=1 |
| 22 | + |
| 23 | +# Debug: show build environment |
| 24 | +env | grep KOKORO |
| 25 | + |
| 26 | +# Setup service account credentials. |
| 27 | +export GOOGLE_APPLICATION_CREDENTIALS=${KOKORO_GFILE_DIR}/service-account.json |
| 28 | + |
| 29 | +# Setup project id. |
| 30 | +export PROJECT_ID=$(cat "${KOKORO_GFILE_DIR}/project-id.json") |
| 31 | + |
| 32 | +# Remove old nox |
| 33 | +python3.6 -m pip uninstall --yes --quiet nox-automation |
| 34 | + |
| 35 | +# Install nox |
| 36 | +python3.6 -m pip install --upgrade --quiet nox |
| 37 | +python3.6 -m nox --version |
| 38 | + |
| 39 | +# If NOX_SESSION is set, it only runs the specified session, |
| 40 | +# otherwise run all the sessions. |
| 41 | +if [[ -n "${NOX_SESSION:-}" ]]; then |
| 42 | + python3.6 -m nox -s "${NOX_SESSION:-}" |
| 43 | +else |
| 44 | + python3.6 -m nox |
| 45 | +fi |
0 commit comments