forked from istio/envoy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
mac_ci_setup.sh
executable file
·45 lines (38 loc) · 1.26 KB
/
mac_ci_setup.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#!/bin/bash
# Installs the dependencies required for a macOS build via homebrew.
# Tools are not upgraded to new versions.
# See:
# https://github.com/actions/virtual-environments/blob/master/images/macos/macos-10.15-Readme.md for
# a list of pre-installed tools in the macOS image.
function is_installed {
brew ls --versions "$1" >/dev/null
}
function install {
echo "Installing $1"
if ! brew install "$1"; then
echo "Failed to install $1"
exit 1
fi
}
if ! brew update; then
echo "Failed to update homebrew"
exit 1
fi
DEPS="automake cmake coreutils go libtool wget ninja"
for DEP in ${DEPS}
do
is_installed "${DEP}" || install "${DEP}"
done
if [ -n "$CIRCLECI" ]; then
# bazel uses jgit internally and the default circle-ci .gitconfig says to
# convert https://github.com to ssh://[email protected], which jgit does not support.
mv ~/.gitconfig ~/.gitconfig_save
fi
# Required as bazel and a foreign bazelisk are installed in the latest macos vm image, we have
# to unlink/overwrite them to install bazelisk
echo "Installing bazelbuild/tap/bazelisk"
brew install --force bazelbuild/tap/bazelisk
if ! brew link --overwrite bazelbuild/tap/bazelisk; then
echo "Failed to install and link bazelbuild/tap/bazelisk"
exit 1
fi