forked from siyelo/laptop
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbootstrap_osx.sh
executable file
·57 lines (44 loc) · 1.42 KB
/
bootstrap_osx.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
#!/bin/sh
# Welcome to the mjfroman laptop script!
#
# This script bootstraps an OSX laptop to a point where we can run
# Ansible on localhost. It;
# 1. Installs
# - xcode
# - homebrew
# - ansible (via brew)
# 2. Kicks off the ansible playbook
# - playbook.yml
#
# It will ask you for your sudo password
fancy_echo() {
local fmt="$1"; shift
# shellcheck disable=SC2059
printf "\n$fmt\n" "$@"
}
fancy_echo "Bootstrapping ..."
trap 'ret=$?; test $ret -ne 0 && printf "failed\n\n" >&2; exit $ret' EXIT
set -e
# Ensure Apple's command line tools are installed - needed for git
# to get started and then other things.
fancy_echo "Prep xcode"
(cd scripts && bash ./prep_xcode.sh)
# Clone the repository to your local drive.
if [ -d "./laptop" ]; then
fancy_echo "Laptop repo dir exists. Removing ..."
rm -rf ./laptop/
fi
fancy_echo "Cloning laptop repo ..."
git clone https://github.com/mjfroman/laptop
fancy_echo "Changing to laptop repo dir ..."
cd laptop
# Ensure brew and ansible are installed
fancy_echo "Prep brew and ansible"
(cd scripts && bash ./prep_brew_ansible.sh)
# Run this from the same directory as this README file.
fancy_echo "Running ansible playbook ..."
#ansible-playbook playbook.yml -i hosts --ask-sudo-pass -vvvv
(cd osx/ && bash ./run_playbooks.sh)
# Finally, do a "basic" bootstrap and clone of firefox
(cd scripts && bash ./clone_firefox_repo.sh)
(cd scripts && bash ./show_final_message.sh)