-
Notifications
You must be signed in to change notification settings - Fork 0
/
run_once_install_dev_tools.sh.tmpl
64 lines (64 loc) · 2.56 KB
/
run_once_install_dev_tools.sh.tmpl
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
#!/bin/sh
GO_VERSION="$(curl -L https://golang.org/VERSION?m=text)"
GO_VERSION=$(echo $GO_VERSION | awk 'NR==1{print $1}' | tr -d '[:space:]')
{{ if eq .chezmoi.os "linux" -}}
sudo apt update
# docker and text editor
if ! [ -x "$(command -v docker)" ]; then
sudo apt install ca-certificates gnupg -y
sudo install -m 0755 -d /etc/apt/keyrings
{{ if eq .chezmoi.osRelease.id "ubuntu" -}}
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
sudo chmod a+r /etc/apt/keyrings/docker.gpg
echo \
"deb [arch="$(dpkg --print-architecture)" signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \
"$(. /etc/os-release && echo "$VERSION_CODENAME")" stable" | \
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
{{ else if eq .chezmoi.osRelease.id "debian" }}
curl -fsSL https://download.docker.com/linux/debian/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
sudo chmod a+r /etc/apt/keyrings/docker.gpg
echo \
"deb [arch="$(dpkg --print-architecture)" signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/debian \
"$(. /etc/os-release && echo "$VERSION_CODENAME")" stable" | \
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
{{ end }}
sudo apt update
sudo apt install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin -y
fi
sudo apt install neovim man age -y
# pyenv + pyenv virtualenv
if ! [ -x "$(command -v pyenv)" ]; then
curl https://pyenv.run | bash
git clone https://github.com/pyenv/pyenv-virtualenv.git $(pyenv root)/plugins/pyenv-virtualenv
fi
# latest ver of go
if ! [ -x "$(command -v go)" ]; then
curl -L https://storage.googleapis.com/golang/$GO_VERSION.linux-amd64.tar.gz -o $GO_VERSION.linux-amd64.tar.gz
rm -rf /usr/local/go && tar -C /usr/local -xzf $GO_VERSION.linux-amd64.tar.gz
rm $GO_VERSION.linux-amd64.tar.gz
fi
# rust cargo
if ! [ -x "$(command -v cargo)" ]; then
curl https://sh.rustup.rs -sSf | sh
fi
{{ else if eq .chezmoi.os "darwin" -}}
# see if homebrew is installed, install it if not
if ! [ -x "$(command -v brew)" ]; then
echo "Installing homebrew"
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> ~/.zprofile
fi
brew update
brew install docker
brew install neovim
if ! [ -x "$(command -v pyenv)" ]; then
brew install pyenv
brew install pyenv-virtualenv
fi
# go
brew install go
# rust cargo
if ! [ -x "$(command -v cargo)" ]; then
curl https://sh.rustup.rs -sSf | sh
fi
{{ end -}}