-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbootstrap
executable file
·72 lines (59 loc) · 2.23 KB
/
bootstrap
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#!/bin/bash
if ! command -v brew >/dev/null; then
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
fi
# Activate the correct brew for the CPU
if [[ "$(uname -m)" == 'arm64' ]]; then
eval "$(/opt/homebrew/bin/brew shellenv)"
else
eval "$(/usr/local/bin/brew shellenv)"
fi
# The TAP_REPO variable is the internal reference that Homebrew uses for the tap.
# Homebrew tap names are normalized to lowercase and omit the 'homebrew-' prefix.
TAP_REPO="consultingmd/ih-public"
# Check if the tap already exists, and if so, untap it to prevent issues caused by the old SSH url
if brew tap | grep -q "$TAP_REPO"; then
echo "Homebrew tap $TAP_REPO already exists. Untapping..."
brew untap "$TAP_REPO"
fi
brew update
echo "Installing ih-core formula..."
echo "Sometimes the dependency downloads fail, possibly due to the VPN, so \
I will retry installing a couple times if it fails."
brew tap ConsultingMD/homebrew-ih-public https://github.com/ConsultingMD/homebrew-ih-public.git
SUCCEEDED=1
for _ in 1 2 3; do
brew install ih-core
SUCCEEDED=$?
if [ $SUCCEEDED -eq 0 ]; then
break
fi
done
if [ $SUCCEEDED -eq 1 ]; then
echo "Install of ih-setup formula failed. Please contact platform support
in the #infrastructure-support channel in Slack (https://ih-epdd.slack.com/archives/C03GXCDA48Y).
You can also search Confluence for 'Engineer Onboarding Guide' for
more troubleshooting tips."
exit 1
fi
if command -v ih-setup; then
ih-setup install
SUCCEEDED=$?
if [ $SUCCEEDED -eq 0 ]; then
echo "Install succeeded. You should be able to start a new shell
and have everything work correctly."
else
echo "Install failed. Please contact platform support
in the #infrastructure-support channel in Slack (https://ih-epdd.slack.com/archives/C03GXCDA48Y).
You can also search Confluence for 'Engineer Onboarding Guide' for
more troubleshooting tips.
You don't need to run the bootstrap script again. You can
now use 'ih-setup install' to re-try installation, or 'ih-setup check'
to get more information."
fi
exit $SUCCEEDED
else
echo "ih-setup is not available in your PATH. Check the logs above to see if there was a fatal error,
and make sure that /usr/local/bin is in your PATH"
exit 1
fi