-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbootstrap.sh
More file actions
executable file
·75 lines (62 loc) · 2.78 KB
/
bootstrap.sh
File metadata and controls
executable file
·75 lines (62 loc) · 2.78 KB
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
#!/bin/bash
echo ""
echo "██████╗ ██╗ ██████╗ ██████╗ ██████╗██╗ ██╗███████╗████████╗";
echo "██╔══██╗██║██╔════╝██╔═══██╗██╔════╝██║ ██║██╔════╝╚══██╔══╝";
echo "██████╔╝██║██║ ██║ ██║██║ ███████║█████╗ ██║ ";
echo "██╔══██╗██║██║ ██║ ██║██║ ██╔══██║██╔══╝ ██║ ";
echo "██║ ██║██║╚██████╗╚██████╔╝╚██████╗██║ ██║███████╗ ██║ ";
echo "╚═╝ ╚═╝╚═╝ ╚═════╝ ╚═════╝ ╚═════╝╚═╝ ╚═╝╚══════╝ ╚═╝ ";
echo ""
export WHOAMI=`whoami`
export RICOCHET="/Users/$WHOAMI/code/ricochet"
abort() { echo "!!! $@" >&2; exit 1; }
log() { echo "--> $@"; }
logn() { echo "--> $@ "; echo ""; }
logk() { echo "OK"; }
logn "Welcome to Ricochet!"
#
# Cloning / updating the Ricochet repository.
#
if [[ ! -d $RICOCHET ]]; then
logn "Hooking you up with an Ricochet in $RICOCHET…"
git clone https://github.com/cobyism/ricochet $RICOCHET
else
logn "Looks like you’ve already got Ricochet cloned. Attempting to update it…"
pushd $RICOCHET >/dev/null
git pull
popd >/dev/null
logn "I sure hope that worked… ¯\_(ツ)_/¯"
fi
#
# Running Strap (https://github.com/mikemcquaid/strap).
#
if [ ! command -v brew >/dev/null 2>&1 ] && [ ! command -v brew cask >/dev/null 2>&1 ]; then
logn "Let’s get you set up first by running strap…"
if [ ! -f ~/Downloads/strap.sh ]; then
logn "It doesn’t look like you’ve downloaded strap.sh yet. Let me open that in a browser for you."
open https://osx-strap.herokuapp.com/strap.sh
abort "Run this again once you’ve got strap.sh in ~/Downloads :)"
else
logn "Running strap.sh…"
source ~/Downloads/strap.sh
logn "Removing strap-created .gitconfig, because we get it via Ricochet"
rm ~/.gitconfig
logn "Successfully finished running strap. Now, onto the good stuff!"
fi
else
logn "Looks like this isn’t you’re first rodeo! Skipping straight to the good stuff."
fi
#
# Ensuring Ansible is installed.
#
if ! command -v ansible-playbook >/dev/null 2>&1; then
logn "Looks like we ain’t got any ansible yet. Let’s do something about that, aye?"
brew install ansible
logn "Ansibled up."
fi
#
# Running Ricochet for the first time.
#
logn "Running Ricochet…"
$RICOCHET/bin/ricochet all
logn "Bing! All done :)"