-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathsetup.sh
More file actions
35 lines (30 loc) · 838 Bytes
/
setup.sh
File metadata and controls
35 lines (30 loc) · 838 Bytes
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
#!/usr/bin/env bash
#set -eoup
function mac::ensure-upstream() {
if [ ! -d mac-dev-playbook ]; then
git clone https://github.com/geerlingguy/mac-dev-playbook
cd mac-dev-playbook
git remote rename origin upstream
ansible-galaxy install -r requirements.yml
else
cd mac-dev-playbook
git fetch --all
git rebase upstream master
cd -
fi
}
function mac::ensure-dependencies() {
xcode-select --install || true
/usr/bin/env bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
brew install ansible mas
}
function mac::apply() {
cd mac-dev-playbook
[ ! -f config.yml ] && ln -s ../config.yml .
ansible-playbook main.yml -i inventory --ask-become-pass
}
function mac::setup() {
mac::ensure-dependencies
mac::ensure-upstream
mac::apply
}