-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdeploy.sh
executable file
·65 lines (52 loc) · 2.11 KB
/
deploy.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
#!/bin/sh
set -eu
# This script is responsible for deploying a minimal development enrironment on
# remote machines. I only want this to work on ubuntu.
echo "Starting deployment..."
echo "Initial state of filesystem:"
df -h
if [ ! -e "ROOT_MARKER" ]; then
echo "This script must be run from the directory in which it was installed"
exit 1
fi
################################################################################
# Creating common dirs and files #
################################################################################
mkdir -p ~/personal
mkdir -p ~/.local/bin
mkdir -p ~/.vim
mkdir -p ~/.config/mc
cp min-vimrc ~/.vimrc
cp min-tmux-conf ~/.tmux.conf
cp mc_ini ~/.config/mc/ini
echo "SELECTED_EDITOR=vim" >~/.selected_editor
################################################################################
# .bashrc #
################################################################################
sed -i 's/HISTSIZE=[0-9]*/HISTSIZE=/' ~/.bashrc
sed -i 's/HISTFILESIZE=[0-9]*/HISTFILESIZE=/' ~/.bashrc
cat eternal-history.sh >>~/.bashrc
{
echo
echo "# Nicer prompt with git branch"
echo "# These lines were automatically appended by the script"
cat bash-prompt
} >>~/.bashrc
################################################################################
# git completion #
################################################################################
cp git-completion.bash ~/.local/git-completion.bash
{
echo
echo "source ${HOME}/.local/git-completion.bash"
} >>~/.bashrc
################################################################################
# Download the necessary software #
################################################################################
progs="tmux vim g++ gcc python3 make mc htop ncdu"
for prog in $progs; do
sudo apt install -q -y "$prog"
done
echo "Minimal deployment finished."
echo "Current state of the filesystem:"
df -h