-
Notifications
You must be signed in to change notification settings - Fork 1
/
install.sh
executable file
·79 lines (59 loc) · 2.4 KB
/
install.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
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
73
74
75
76
77
78
79
#!/usr/bin/env zsh
# Our public boootstrap entry point
set -e
cat << "EOF"
__ __ _ _____ ____
\ \ / /__| | ___ ___ _ __ ___ ___ |_ _|__ / / /
\ \ /\ / / _ \ |/ __/ _ \| _ _ \ / _ \ | |/ _ \ / / /
\ V V / __/ | (_| (_) | | | | | | __/ | | (_) | / / /
\_/\_/ \___|_|\___\___/|_| |_| |_|\___| |_|\___/ / / /
_ _ ____ _____ ___ ____ _ ____ / / /
| | | | _ \_ _|_ _/ ___| | __ \ \ \ / / /
| | | | |_) || | | | | | |/ / \ \ \ / / /
| |_| | __/ | | | | |___| < \ \ \ / / /
\___/|_| |_| |___\____|_|\_\ \ \ \/ / /
\ \ / /
\ \/ /
\__/
EOF
sleep 1
echo "Fetching our bootstrap repository ..."
curl -L -o /tmp/master.zip http://github.com/uptick/bootstrap-public/zipball/master/ > /dev/null
export PATH=/opt/homebrew/bin:/opt/homebrew/sbin:$PATH
rm -rf /tmp/bootstrap || true
unzip /tmp/master.zip -d /tmp/bootstrap > /dev/null
cd /tmp/bootstrap/*/
echo "1) Installing xcode"
xcode-select --install || true > /dev/null
echo "2) Installing ansible"
while ! python3 -m pip install ansible > /dev/null; do
echo "Press [Enter] to continue after xcode-select is installed. Required for ansible"
read
done
function install_brew() {
if [ -e /opt/homebrew/bin/brew ]; then
echo "Homebrew is already installed."
else
echo "Installing Homebrew."
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
eval $(/opt/homebrew/bin/brew shellenv)
/opt/homebrew/bin/brew update
/opt/homebrew/bin/brew upgrade
fi
}
echo "3) Installing home brew";
install_brew
echo "4) Generating ssh key";
if [ -e ~/.ssh/id_ed25519.pub ]; then
echo "The ssh key exists."
else
echo "The ssh key does not exist."
ssh-keygen -t ed25519 -f ~/.ssh/id_ed25519
fi
ssh-add ~/.ssh/id_ed25519
echo "5) Reading user settings"
python3 read_user_config.py
echo "6) Running ansible playbook. When it asks for `BECOME passwowrd:` please enter your mac user password. This is required for sudo access."
python3 -m ansible playbook main.yml --ask-become-pass
echo "7) Running the second part of the bootstrap script"
cd ~/bootstrap && zsh bootstrap.sh