1- #
2- # Licensed to the Apache Software Foundation (ASF) under one
3- # or more contributor license agreements. See the NOTICE file
4- # distributed with this work for additional information
5- # regarding copyright ownership. The ASF licenses this file
6- # to you under the Apache License, Version 2.0 (the
7- # "License"); you may not use this file except in compliance
8- # with the License. You may obtain a copy of the License at
9- #
10- # http://www.apache.org/licenses/LICENSE-2.0
11- #
12- # Unless required by applicable law or agreed to in writing,
13- # software distributed under the License is distributed on an
14- # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15- # KIND, either express or implied. See the License for the
16- # specific language governing permissions and limitations
17- # under the License.
18- #
19-
20- #! /bin/bash
21-
1+ #! /bin/sh
222
233sudo apt update
244sudo apt install apt-transport-https curl gnupg -y
@@ -29,34 +9,11 @@ curl -fsSL https://bazel.build/bazel-release.pub.gpg | gpg --dearmor > bazel.gpg
299sudo mv bazel.gpg /etc/apt/trusted.gpg.d/
3010echo " deb [arch=amd64] https://storage.googleapis.com/bazel-apt stable jdk1.8" | sudo tee /etc/apt/sources.list.d/bazel.list
3111curl https://bazel.build/bazel-release.pub.gpg | sudo apt-key add -
32- sudo apt update && sudo apt install bazel=6 .0.0 -y
12+ sudo apt update && sudo apt install bazel=5 .0.0 -y
3313sudo apt install clang-format -y
3414rm $PWD /.git/hooks/pre-push
3515ln -s $PWD /hooks/pre-push $PWD /.git/hooks/pre-push
3616
37- bazel --version
38- ret=$?
39-
40- if [[ $ret != " 0" ]]; then
41-
42- sudo apt-get install build-essential openjdk-11-jdk zip unzip -y
43- rm bazel-6.0.0-dist.zip
44- rm -rf bazel_build
45- wget wget https://releases.bazel.build/6.0.0/release/bazel-6.0.0-dist.zip
46- mkdir -p bazel_build
47- mv bazel-6.0.0-dist.zip bazel_build/
48- cd bazel_build
49-
50- unzip bazel-6.0.0-dist.zip
51-
52- export JAVA_HOME=' /usr/lib/jvm/java-1.11.0-openjdk-arm64/'
53- env EXTRA_BAZEL_ARGS=" --host_javabase=@local_jdk//:jdk" bash ./compile.sh
54- sudo cp output/bazel /usr/local/bin/
55- cd ..
56- rm -rf bazel_build
57-
58- fi
59-
6017# install buildifier
6118bazel build @com_github_bazelbuild_buildtools//buildifier:buildifier
6219
0 commit comments