-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall
More file actions
executable file
·73 lines (62 loc) · 2.05 KB
/
install
File metadata and controls
executable file
·73 lines (62 loc) · 2.05 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
#!/usr/bin/env bash
# Ubuntu 20+ installation
set -ex
# version manager
if ! command -v mise &> /dev/null; then
curl https://mise.run | sh
echo 'eval "$(~/.local/bin/mise activate bash)"' >> ~/.bashrc
else
echo "Mise already installed"
fi
# mise can't seem to figure out the dependency ordering so these
# need to be separate from the file
mise use -g python@3.11.12 && mise use -g node@24.0.0 && mise use -g cosign@latest && mise use -g pipx@1.8.0
mise install
CONFIG="install.conf.yaml"
DOTBOT_DIR="dotbot"
DOTBOT_BIN="bin/dotbot"
BASEDIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
cd "${BASEDIR}"
git -C "${DOTBOT_DIR}" submodule sync --quiet --recursive
git submodule update --init --recursive "${DOTBOT_DIR}"
"${BASEDIR}/${DOTBOT_DIR}/${DOTBOT_BIN}" -d "${BASEDIR}" -c "${CONFIG}" "${@}"
# tmux plugin setup
if [ ! -d ~/.tmux/plugins/tpm ]; then
git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm
else
echo "TPM already installed"
fi
if [ ! -f ~/.git-templates/hooks/commit-msg ]; then
git config --global init.templatedir "~/.git-templates"
mkdir -p ~/.git-templates/hooks
cat > ~/.git-templates/hooks/commit-msg <<'EOF'
#!/bin/sh
JIRA_TICKET=$(git symbolic-ref --short HEAD | grep -oE '^[A-Z]+-[0-9]+')
if [ ! -z "$JIRA_TICKET" ]; then
COMMIT_MSG=$(cat $1)
echo "$JIRA_TICKET $COMMIT_MSG" > $1
fi
EOF
chmod +x ~/.git-templates/hooks/commit-msg
fi
sudo apt update && sudo apt install xclip unzip libasound2t64 libnss3 libxss1 libgbm-dev build-essential
# Bashrc aliases
# ------------------------------------------------------------------------------
echo "alias v='nvim'" >> ~/.bashrc
echo "alias vi='nvim'" >> ~/.bashrc
cat >> ~/.bashrc <<'EOF'
function dockerexec() {
docker exec -it "$1" /bin/bash
}
alias dockerexec='dockerexec'
function klog() {
stern -t "$1" | grep -v health
}
alias klog='klog'
TERM=tmux-256color
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
}
PS1='\[\033[32m\]\w\[\033[33m\]\$(parse_git_branch)\[\033[00m\] $ '
bind 'set bell-style none'
EOF