Files
runner-images/images/ubuntu/scripts/build/install-bazel.sh
T

25 lines
904 B
Bash
Raw Normal View History

2020-10-07 13:49:40 +05:00
#!/bin/bash -e
2020-02-26 10:53:26 +03:00
################################################################################
2023-11-22 21:49:23 +01:00
## File: install-bazel.sh
## Desc: Install Bazel and Bazelisk (A user-friendly launcher for Bazel)
2020-02-26 10:53:26 +03:00
################################################################################
2023-12-29 12:36:27 +01:00
# Source the helpers for use with the script
source $HELPER_SCRIPTS/install.sh
source $HELPER_SCRIPTS/etc-environment.sh
2020-02-26 10:53:26 +03:00
# Install bazelisk
npm install -g @bazel/bazelisk
# Run bazelisk once in order to install /usr/local/bin/bazel binary
bazel version
# Get the installed Bazel version from bazelisk
BAZEL_VERSION=$(bazel --version | grep "Build label:" | awk '{print $3}')
# Set USE_BAZEL_FALLBACK_VERSION so that users without .bazelversion
# get the preinstalled version instead of downloading latest
set_etc_environment_variable "USE_BAZEL_FALLBACK_VERSION" "silent:${BAZEL_VERSION}"
invoke_tests "Tools" "Bazel"