forked from uptick/bootstrap-public
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbootstrap.sh
executable file
·43 lines (32 loc) · 1.01 KB
/
bootstrap.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
# /bin/zsh
set -e
if [ -e ~/.ssh/id_rsa ]; then
echo "The id_rsa key exists."
else
echo "The id_rsa key does not exist."
ssh-keygen -t rsa -f ~/.ssh/id_rsa
fi
# We need to support passworded ssh-keys
ssh-add
export PATH=/opt/homebrew/bin:/opt/homebrew/sbin:$PATH
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)"
brew update
brew upgrade
fi
}
echo "1) Installing xcode"
xcode-select --install || true > /dev/null
echo "2) Installing ansible"
python3 -m pip install ansible > /dev/null
echo "3) Installing brew"
install_brew()
echo "4) Running ansible playbook"
echo "Please enter your user password (so ansible can run sudo for you)"
python3 -m ansible playbook main.yml --ask-become-pass
echo "5) Executing private bootstrap script"
cd ~/bootstrap/ && zsh ~/bootstrap/bootstrap.sh