-
Notifications
You must be signed in to change notification settings - Fork 0
/
bootstrap
executable file
·72 lines (61 loc) · 1.98 KB
/
bootstrap
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
#!/bin/bash
set -e
bootstrap_macos() {
# Install Homebrew if not installed
which -s brew
if [[ $? != 0 ]]; then
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
fi
# Install Homebrew packages from Brewfile
brew bundle --file dotfiles/brew/Brewfile
}
boostrap_ubuntu() {
# Install curl, some distributions don't have it installed upfront
sudo apt install curl --yes
# Add apt repositories and update apt
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu bionic stable" --no-update --yes
sudo apt update
# Install apt packages, necessary for Docker, Homebrew and some of the Vim plugins
sudo apt install --yes \
apache2-utils \
apt-transport-https \
build-essential \
ca-certificates \
cmake \
containerd.io \
curl \
docker-ce \
docker-ce-cli \
exuberant-ctags \
file \
git \
gnupg-agent \
pm-utils \
python3-dev \
software-properties-common
# Add user to a docker group
sudo groupadd docker -f
sudo usermod -aG docker $USER
# Install Homebrew if not installed
which -s brew
if [[ $? != 0 ]]; then
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
fi
# Add Homebrew to PATH so that packages can be installed below
# We're setting SHELL to "bash" temporarily because this script is executed with #!/bin/bash
# Otherwise bootstrap wouldn't work if executed from fish shell
eval $(SHELL=/bin/bash /home/linuxbrew/.linuxbrew/bin/brew shellenv)
# Install Homebrew packages from Brewfile
brew bundle --file dotfiles/brew/Brewfile
# Install Go if not installed
which -s go
if [[ $? != 0 ]]; then
wget -qO- https://dl.google.com/go/go1.14.2.linux-amd64.tar.gz | sudo tar xzf - -C /usr/local
fi
}
if [ "$(uname)" == "Darwin" ]; then
bootstrap_macos
else
bootstrap_ubuntu
fi