forked from DawnAngel/dotfiles
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup_new_computer.sh
More file actions
executable file
·134 lines (99 loc) · 3.38 KB
/
Copy pathsetup_new_computer.sh
File metadata and controls
executable file
·134 lines (99 loc) · 3.38 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
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
#!/bin/bash
BASEDIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
check_and_link () {
ORIGIN=$1
DESTINATION=$2
if [ ! -L ~/${DESTINATION} ]; then
echo "LINK: ~/${DESTINATION} ✅"
ln -s ${BASEDIR}/${ORIGIN} ~/${DESTINATION}
else
echo "LINK: ~/${DESTINATION} ✘"
fi
}
check_and_copy () {
ORIGIN=$1
DESTINATION=$2
if [ ! -f ~/${DESTINATION} ]; then
echo "COPY: ~/${DESTINATION} ✅"
cp ${BASEDIR}/${ORIGIN} ~/${DESTINATION}
else
echo "COPY: ~/${DESTINATION} ✘"
fi
}
########################################
############# BOOTSTRAPING #############
########################################
echo "# Installing homebrew..."
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
# Install brew tools
brew install zsh
brew install wget
brew install pyenv
brew install pyenv-virtualenv
brew install asdf
brew install gnupg
pyenv install 3.8.6
pyenv global 3.8.6
echo "# Installing Powerline fonts..."
# clone
git clone https://github.com/powerline/fonts.git --depth=1
# install
cd fonts
./install.sh
# clean-up
cd ..
rm -rf fonts
echo "# Installing Oh-my-zsh..."
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" "" --unattended
echo "# Installing zsh-autosuggestions..."
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
echo "# Installing fast-syntax-highlighting..."
git clone https://github.com/zdharma/fast-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/fast-syntax-highlighting
echo "# Installing powerlevel10k..."
git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k
##### K8s #####
echo "Installing kubectl"
brew install kubectl
echo "Installing kubens and kubectx"
brew install kubectx
#### Python Poetry ####
curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python -
mkdir $ZSH_CUSTOM/plugins/poetry
poetry completions zsh > $ZSH_CUSTOM/plugins/poetry/_poetry
#### AWS ####
echo "Installing AWS CLI V2..."
curl "https://awscli.amazonaws.com/AWSCLIV2.pkg" -o "AWSCLIV2.pkg"
sudo installer -pkg AWSCLIV2.pkg -target /
rm -rf AWSCLIV2.pkg
echo "AWS IAM authenticator (K8s)"
brew install aws-iam-authenticator
echo "Installing assume-role"
brew install remind101/formulae/assume-role
####################################################
############ LINKS AND CUSTOM SETTINGS #############
####################################################
# LINK .vimrc
check_and_link "vimrc" ".vimrc"
# LINK .gitconfig
check_and_link "gitconfig" ".gitconfig"
# LINK .gitignore_global
check_and_link "gitignore_global" ".gitignore_global"
# LINK .gitconfig
check_and_link "oh-my-zsh-themes/agnoster-carlos.zsh-theme" ".oh-my-zsh/custom/themes/agnoster-carlos.zsh-theme"
# MKDR .ssh/
mkdir -p ~/.ssh
# COPY .ssh/config
check_and_copy "ssh/config" ".ssh/config"
echo "Changing default shell to zsh"
echo $(which zsh) | sudo tee -a /etc/shells
chsh -s $(which zsh)
# LINK .zshrc
check_and_link "zshrc" ".zshrc"
# LINK .p10k.zsh
check_and_link "p10k.zsh" ".p10k.zsh"
################ POST-INSTALL NOTES ################
echo "____________________"
echo "____________________"
echo "______FINISHED______"
echo "____________________"
echo "____________________"