diff options
author | Thibaut Goetghebuer-Planchon <thibaut.goetghebuer-planchon@arm.com> | 2022-07-06 10:23:22 +0100 |
---|---|---|
committer | Thibaut Goetghebuer-Planchon <thibaut.goetghebuer-planchon@arm.com> | 2022-08-18 14:35:45 +0100 |
commit | 52dacd6556d60815253d4e4938e218ea3d8084a2 (patch) | |
tree | 4c470c567da6f70f65987d5af161bf4f950d107b /docker/install/install_bazel.sh | |
parent | cc5d89eea4ff3dc398cac3b6025450f48ac20c1e (diff) | |
download | tosa_checker-52dacd6556d60815253d4e4938e218ea3d8084a2.tar.gz |
Initial commit0.1.0-rc.1
Change-Id: I2fb0933d595a6ede6417d09dd905ef72d6c60c9b
Diffstat (limited to 'docker/install/install_bazel.sh')
-rwxr-xr-x | docker/install/install_bazel.sh | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/docker/install/install_bazel.sh b/docker/install/install_bazel.sh new file mode 100755 index 0000000..687ed13 --- /dev/null +++ b/docker/install/install_bazel.sh @@ -0,0 +1,24 @@ +#!/usr/bin/env bash +# SPDX-FileCopyrightText: Copyright 2022, Arm Limited and/or its affiliates. +# SPDX-License-Identifier: Apache-2.0 +BAZEL_VERSION="$1" +shift + +set +e +local_bazel_ver=$(bazel version 2>&1 | grep -i label | awk '{print $3}') + +if [[ "$local_bazel_ver" == "$BAZEL_VERSION" ]]; then + exit 0 +fi + +set -e + +# Install Bazelâ„¢ +mkdir -p /bazel +cd /bazel +if [[ ! -f "bazel-$BAZEL_VERSION-installer-linux-x86_64.sh" ]]; then + curl -fSsL -O https://github.com/bazelbuild/bazel/releases/download/$BAZEL_VERSION/bazel-$BAZEL_VERSION-installer-linux-x86_64.sh +fi +chmod +x /bazel/bazel-*.sh +/bazel/bazel-$BAZEL_VERSION-installer-linux-x86_64.sh +rm -f /bazel/bazel-$BAZEL_VERSION-installer-linux-x86_64.sh |