Fix undeclared variable error in common_build.sh.

PiperOrigin-RevId: 293413711
This commit is contained in:
Brad Burlage 2020-02-05 11:33:48 -08:00 committed by gVisor bot
parent eea0eeee93
commit f2d3efca1d
1 changed files with 6 additions and 6 deletions

View File

@ -32,21 +32,21 @@ declare -r BAZEL_FLAGS=(
"--keep_going"
"--verbose_failures=true"
)
BAZEL_RBE_AUTH_FLAGS=""
BAZEL_RBE_FLAGS=""
if [[ -v KOKORO_BAZEL_AUTH_CREDENTIAL ]]; then
declare -r BAZEL_RBE_AUTH_FLAGS=(
"--auth_credentials=${KOKORO_BAZEL_AUTH_CREDENTIAL}"
)
declare -r BAZEL_RBE_FLAGS=("--config=remote")
declare -r BAZEL_RBE_AUTH_FLAGS="--auth_credentials=${KOKORO_BAZEL_AUTH_CREDENTIAL}"
declare -r BAZEL_RBE_FLAGS="--config=remote"
fi
# Wrap bazel.
function build() {
bazel build "${BAZEL_RBE_FLAGS[@]}" "${BAZEL_RBE_AUTH_FLAGS[@]}" "${BAZEL_FLAGS[@]}" "$@" 2>&1 |
bazel build "${BAZEL_RBE_FLAGS}" "${BAZEL_RBE_AUTH_FLAGS}" "${BAZEL_FLAGS[@]}" "$@" 2>&1 |
tee /dev/fd/2 | grep -E '^ bazel-bin/' | awk '{ print $1; }'
}
function test() {
bazel test "${BAZEL_RBE_FLAGS[@]}" "${BAZEL_RBE_AUTH_FLAGS[@]}" "${BAZEL_FLAGS[@]}" "$@"
bazel test "${BAZEL_RBE_FLAGS}" "${BAZEL_RBE_AUTH_FLAGS}" "${BAZEL_FLAGS[@]}" "$@"
}
function run() {