[ubuntu] Configure USE_BAZEL_FALLBACK_VERSION for Bazelisk (#13605)
This commit is contained in:
@@ -6,11 +6,19 @@
|
|||||||
|
|
||||||
# Source the helpers for use with the script
|
# Source the helpers for use with the script
|
||||||
source $HELPER_SCRIPTS/install.sh
|
source $HELPER_SCRIPTS/install.sh
|
||||||
|
source $HELPER_SCRIPTS/etc-environment.sh
|
||||||
|
|
||||||
# Install bazelisk
|
# Install bazelisk
|
||||||
npm install -g @bazel/bazelisk
|
npm install -g @bazel/bazelisk
|
||||||
|
|
||||||
# run bazelisk once in order to install /usr/local/bin/bazel binary
|
# Run bazelisk once in order to install /usr/local/bin/bazel binary
|
||||||
sudo -u $SUDO_USER bazel version
|
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"
|
invoke_tests "Tools" "Bazel"
|
||||||
|
|||||||
Reference in New Issue
Block a user