blob: 4b57afaff65854b3dcac83bc068d58f110f11f60 [file] [log] [blame]
Ray Milkeyd83ef8e2018-11-09 11:57:01 -08001#!/bin/bash
2
3# exit on errors
4set -eu -o pipefail
5
Ray Milkey14b7f492019-02-28 12:22:01 -08006if [ ${GERRIT_BRANCH} == "onos-1.14" ]
Ray Milkeye4d74a22019-02-26 15:16:10 -08007then
Ray Milkeye4d74a22019-02-26 15:16:10 -08008 BAZEL_VERSION="0.19.2"
Ray Milkey14b7f492019-02-28 12:22:01 -08009else
Ray Milkey5a0238c2020-01-21 15:47:52 -080010 if [ ${GERRIT_BRANCH} == "master" -o ${GERRIT_BRANCH} == "onos-2.2" -o ${GERRIT_BRANCH} == "onos-2.3" -o ${GERRIT_BRANCH} == "onos-1.15" ]; then
Ray Milkey502c6722019-10-14 16:15:11 -070011 BAZEL_VERSION="1.0.0"
Ray Milkey8da6fce2019-06-17 14:31:11 -070012 else
13 BAZEL_VERSION="0.24.1"
14 fi
Ray Milkeye4d74a22019-02-26 15:16:10 -080015fi
Ray Milkeyd83ef8e2018-11-09 11:57:01 -080016
17if [ ${BAZEL_VERSION} != "none" ]
18then
19 echo Installing bazel version ${BAZEL_VERSION}
20 curl -L -o bazel.sh -s https://github.com/bazelbuild/bazel/releases/download/${BAZEL_VERSION}/bazel-${BAZEL_VERSION}-installer-linux-x86_64.sh
Ray Milkey9fea0cd2019-11-15 12:52:21 -080021 chmod +x bazel.sh
Ray Milkey96e7ada2019-04-04 15:47:44 -070022 ./bazel.sh --user
Ray Milkeyd83ef8e2018-11-09 11:57:01 -080023else
24 echo Not installing bazel
25fi
26
Ray Milkey4cf12d62018-11-09 13:10:50 -080027