-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathall-install.sh
executable file
·160 lines (119 loc) · 8.33 KB
/
all-install.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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
#!/usr/bin/env bash
set -euxo pipefail
# apt|dnf-install.sh has DNF RPM / APT DEB packages, this is everything else
DIR="$(realpath $(dirname "$0"))"
[ -s /usr/bin/nano ] || [ -s "$HOME"/bin/nano ] || "$(dirname "$0")"/install-nano.sh
# see https://github.com/jorgebucaran/fisher/issues/742
# and https://github.com/vorburger/dotfiles-reproduce-problem
# and https://github.com/orgs/community/discussions/35527
exec </dev/null
fish "$DIR"/fish-install.fish
# https://github.com/jorgebucaran/fisher
[ -s "$HOME"/.config/fish/functions/fisher.fish ] || ( \
curl -sL https://git.io/fisher -o /tmp/fisher && \
fish -c "source /tmp/fisher && fisher install jorgebucaran/fisher")
# https://starship.rs
if [ ! -f /usr/local/bin/starship ]; then
curl -fsSL https://starship.rs/install.sh -o /tmp/starship-install.sh
chmod +x /tmp/starship-install.sh
sudo /tmp/starship-install.sh --yes
fi
# https://github.com/junegunn/fzf#using-git
# if [ ! $(command -v fzf) ]; then
if [ ! -d ~/.fzf ]; then
git clone --depth 1 https://github.com/junegunn/fzf.git ~/.fzf
~/.fzf/install --all
fi
~/.fzf/bin/fzf --version
# Go NOT like this, because this assumes we have an older golang system package, which is confusing:
# go get golang.org/dl/go1.15.8
# eval $(go1.15.8 env GOROOT)
# https://golang.org/doc/install
if [ ! $(command -v go) ]; then
curl -fsSL https://golang.org/dl/go1.17.5.linux-amd64.tar.gz -o /tmp/go.tgz
sudo tar -C /usr/local -xzf /tmp/go.tgz
sudo ln -s /usr/local/go/bin/go* /usr/local/bin/
fi
go version
# https://github.com/apache/maven-mvnd/
# TODO Fix broken installation on GitHub Codespaces (but I currently don't use it anyway)
# mkdir -p $HOME/.m2/ $HOME/bin/
# [ -s $HOME/bin/mvnd ] || "$(dirname "$0")"/install-github.sh apache/maven-mvnd 0.8.0 maven-mvnd-0.8.0-linux-amd64 mvnd && \
# mv /tmp/install-github/apache/maven-mvnd/mvnd-0.8.0-linux-amd64 $HOME/bin/ && \
# ln -s $HOME/bin/mvnd-0.8.0-linux-amd64/bin/mvnd $HOME/bin
# [ -s $HOME/.m2/mvnd.properties ] || echo "java.home=/etc/alternatives/java_sdk/" >$HOME/.m2/mvnd.properties
# GO_BIN_PATH may not match GOPATH (it could be unset)
GO_BIN_PATH=$(go env GOPATH)/bin
# ===============================================================================================================================
# Like in apt-install.sh, most of these tools don't need to be pre-installed into GitHub Codespaces, or only via prebuilt Dev Container:
if [[ -z "${CODESPACES:-}" ]]; then
# NB alias b="bazelisk " in dotfiles/alias
# NB alias bazel (with completion) in dotfiles/fish/completions/bazel.fish for Fish Shell (only; N/A in Bash, and from Scripts)
# NB We symlink "bazel" here, because this is better than the "delegating shell script" used originally (because of https://github.com/salesforce/bazel-eclipse/issues/477 like non-"bash -c" from IDE and other such tools)
# We use "$GO_BIN_PATH"/bazel instead of e.g. "$HOME"/bin/bazel because that should be in the PATH more often than our more "custom" ~/bin
[ -s "$GO_BIN_PATH"/bazelisk ] || (go install github.com/bazelbuild/bazelisk@latest && ln -s "$GO_BIN_PATH"/bazelisk "$GO_BIN_PATH"/bazel)
# https://github.com/bazelbuild/buildtools/tree/master/buildifier
[ -s "$GO_BIN_PATH"/buildifier ] || go install github.com/bazelbuild/buildtools/buildifier@latest
# https://github.com/bazelbuild/buildtools/blob/master/buildozer/README.md
[ -s "$GO_BIN_PATH"/buildozer ] || go install github.com/bazelbuild/buildtools/buildozer@latest
# https://github.com/bazelbuild/bazel-watcher
# npm install -g @bazel/ibazel
# https://github.com/yoheimuta/protolint
[ -s "$GO_BIN_PATH"/protolint ] || go install github.com/yoheimuta/protolint/cmd/protolint@latest
# https://github.com/mikefarah/yq#go-get
[ -s "$GO_BIN_PATH"/yq ] || go install github.com/mikefarah/yq/v4@latest
# https://github.com/hidetatz/kubecolor (WAS https://github.com/dty1er/kubecolor)
# ALSO https://github.com/kubecolor/kubecolor/; see https://github.com/hidetatz/kubecolor/issues/95
# (also https://github.com/hidetatz/kubecolor/issues/101 and https://github.com/hidetatz/kubecolor/issues/113)
[ -s "$GO_BIN_PATH"/kubecolor ] || go install github.com/hidetatz/kubecolor/cmd/kubecolor@latest
# https://github.com/yannh/kubeconform#Installation
[ -s "$GO_BIN_PATH"/kubeconform ] || go install github.com/yannh/kubeconform/cmd/kubeconform@latest
# https://rustup.rs (AKA cargo)
[ -s "$HOME"/.rustup/settings.toml ] || curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
# https://github.com/cargo-bins/cargo-binstall (AKA cargo binstall)
[ -s "$HOME/.cargo/bin/cargo-binstall" ] || curl -L --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.sh | bash
# https://github.com/BurntSushi/ripgrep (via Cargo instead of DNF or APT to have latest version 14+ because v13 didn't support "rg --generate" for https://github.com/BurntSushi/ripgrep/blob/master/FAQ.md#complete
[ $(command -v rg) ] || /home/vorburger/.cargo/bin/cargo binstall --no-confirm ripgrep
# https://github.com/Peltoche/lsd#from-source
[ $(command -v lsd) ] || /home/vorburger/.cargo/bin/cargo binstall --no-confirm lsd
# https://github.com/swsnr/mdcat
# NB: binstall NOK: "mdcat: error while loading shared libraries: libssl.so.1.1: cannot open shared object file: No such file or directory" (even with dnf install openssl-devel, which install mdcat also needs)
# [ $(command -v mdcat) ] || /home/vorburger/.cargo/bin/cargo binstall --no-confirm mdcat
[ $(command -v mdcat) ] || /home/vorburger/.cargo/bin/cargo install mdcat
# https://github.com/evanlucas/fish-kubectl-completions
# TODO remove when https://github.com/kubernetes/kubectl/issues/576 is available
# see https://github.com/evanlucas/fish-kubectl-completions/issues/33
[ -s "$HOME"/.config/fish/completions/kubectl.fish ] || fish -c "fisher install evanlucas/fish-kubectl-completions"
# https://github.com/lgathy/google-cloud-sdk-fish-completion for gcloud
[ -s "$HOME"/.config/fish/completions/gcloud.fish ] || fish -c "fisher install lgathy/google-cloud-sdk-fish-completion"
# ToDo: https://github.com/edc/bass ?
# https://asdf-vm.com/guide/getting-started.html
# dotfiles/fish/conf.d/asdf.fish has the Fish shell related initialization
[ -d "$HOME"/.asdf ] || git clone https://github.com/asdf-vm/asdf.git ~/.asdf --branch v0.13.1
[ -s "$HOME"/.config/fish/completions/asdf.fish ] || ln -s ~/.asdf/completions/asdf.fish ~/.config/fish/completions
~/.asdf/bin/asdf plugin-add deno https://github.com/asdf-community/asdf-deno.git
# TODO Manage *all* Java installations with ASDF instead of DNF?!
# ~/.asdf/bin/asdf plugin-add java https://github.com/halcyon/asdf-java.git
# https://www.jbang.dev/documentation/guide/latest/installation.html
curl -Ls https://sh.jbang.dev | bash -s - app setup
ln -fs ~/.jbang/bin/jbang ~/bin/jbang
fi
# ===============================================================================================================================
# Here come the tools minimally required tools that we *DO* want to install in all Codespaces
# (Some of the above, and other tools, could still be installed via prebuilt Dev Container on a per-project basis.)
# https://github.com/PatrickF1/fzf.fish
# TODO https://github.com/PatrickF1/fzf.fish/discussions/111 how to TMUX?
# TODO https://github.com/PatrickF1/fzf.fish/discussions/112 how to hide . files/dirs?
# TODO [ -s $HOME/.config/fish/functions/__fzf* ] || ...
[ -s "$HOME"/.config/fish/conf.d/fzf.fish ] || fish -c "fisher install PatrickF1/fzf.fish"
# https://github.com/jorgebucaran/autopair.fish
[ -s "$HOME"/.config/fish/conf.d/autopair.fish ] || fish -c "fisher install jorgebucaran/autopair.fish"
# https://github.com/Gazorby/fish-abbreviation-tips
[ -s "$HOME"/.config/fish/conf.d/abbr_tips.fish ] || fish -c "fisher install gazorby/fish-abbreviation-tips"
# https://github.com/nickeb96/puffer-fish for ... to ../.. and !! to inline previous command and !$ prev. arg
[ -s "$HOME"/.config/fish/conf.d/puffer_fish_key_bindings.fish ] || fish -c "fisher install nickeb96/puffer-fish"
fish -c "fisher update"
# PS: ADD ALL fisher generated fish functions to .gitignore instead of committing them!
# To install Python related stuff, use project-specific virtual environments;
# see my https://github.com/vorburger/Notes/blob/master/Reference/python.md,
# and note dotfiles/fish/functions/venv.fish