-
Notifications
You must be signed in to change notification settings - Fork 20
/
Copy pathmacSetup.sh
332 lines (274 loc) · 8.71 KB
/
macSetup.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
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
#!/bin/bash
start=`date +%s`
bold=$(tput bold)
normal=$(tput sgr0)
red=`tput setaf 1`
green=`tput setaf 2`
reset=`tput sgr0`
# if test ! $(which gcc); then
# echo "Installing command line developer tools..."
# xcode-select --install
# fi
if test ! $(which brew); then
echo "Installing homebrew..."
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew install caskroom/cask/brew-cask
brew tap homebrew/cask-versions
brew tap homebrew/cask-cask
brew tap 'homebrew/bundle'
brew tap 'homebrew/cask'
brew tap 'homebrew/cask-drivers'
brew tap 'homebrew/cask-fonts'
brew tap 'homebrew/core'
brew tap 'homebrew/services'
brew tap aws/tap
fi
echo "Updating homebrew..."
brew update
brew upgrade
beginDeploy() {
echo
echo "${bold}$1${normal}"
}
############# General Tools #############
beginDeploy "############# General Tools #############"
echo -n "Do you wish to install General Tools (${bold}${green}y${reset}/${bold}${red}n${reset})? "
read General
CaskGeneralToolList=(
google-chrome
firefox
spotify
)
if [ "$General" != "${General#[Yy]}" ] ;then
echo Yes
brew install --cask --appdir="/Applications" ${CaskGeneralToolList[@]}
else
echo No
fi
############# Designer #############
beginDeploy "############# Designer #############"
echo -n "Do you wish to install Designer Tools (${bold}${green}y${reset}/${bold}${red}n${reset})? "
read Designer
CaskDesignerToolList=(
adobe-creative-cloud
)
if [ "$Designer" != "${Designer#[Yy]}" ] ;then
echo Yes
brew install --cask --appdir="/Applications" ${CaskDesignerToolList[@]}
else
echo No
fi
############# Mobile Developer #############
beginDeploy "############# Mobile Developer #############"
echo -n "Do you wish to install Mobile Developer Tools (${bold}${green}y${reset}/${bold}${red}n${reset})? "
read MobileDeveloper
CaskMobileDeveloperToolList=(
fastlane
)
if [ "$MobileDeveloper" != "${MobileDeveloper#[Yy]}" ] ;then
echo Yes
brew install --cask ${CaskMobileDeveloperToolList[@]}
else
echo No
fi
############# Developer Utilities #############
beginDeploy "############# Developer Utilities #############"
echo -n "Do you wish to install Developer Utilities (${bold}${green}y${reset}/${bold}${red}n${reset})? "
read DeveloperUtilities
DeveloperUtilitiesList=(
tree
ctop
jq
httpie
yarn
yarn-completion
netcat
nmap
wget
go
nvm
bash-completion
)
CaskDeveloperUtilitiesList=(
cheatsheet
spectacle
postman
dotnet-sdk
wireshark
# google-chrome-canary
# firefox-developer-edition
)
if [ "$DeveloperUtilities" != "${DeveloperUtilities#[Yy]}" ] ;then
echo Yes
brew install ${DeveloperUtilitiesList[@]}
brew install --cask ${CaskDeveloperUtilitiesList[@]}
mkdir ~/.nvm
echo '
# NVM CONFIG
export NVM_DIR="$HOME/.nvm"
[ -s "$(brew --prefix)/opt/nvm/nvm.sh" ] && . "$(brew --prefix)/opt/nvm/nvm.sh" # This loads nvm
[ -s "$(brew --prefix)/opt/nvm/etc/bash_completion.d/nvm" ] && . "$(brew --prefix)/opt/nvm/etc/bash_completion.d/nvm" # This loads nvm bash_completion' >> ~/.bash_profile
echo '
# BASH-COMPLETION CONFIG
[[ -r "$(brew --prefix)/etc/profile.d/bash_completion.sh" ]] && . "$(brew --prefix)/etc/profile.d/bash_completion.sh"' >> ~/.bash_profile
curl -s "https://get.sdkman.io" | bash
echo '
# THIS MUST BE AT THE END OF THE FILE FOR SDKMAN TO WORK!!!
export SDKMAN_DIR="/Users/mpatel/.sdkman"
[[ -s "/Users/mpatel/.sdkman/bin/sdkman-init.sh" ]] && source "${HOME}/.sdkman/bin/sdkman-init.sh"' >> ~/.bash_profile
else
echo No
fi
############# Database Tools #############
beginDeploy "############# Database Tools #############"
echo -n "Do you wish to install Database Tools (${bold}${green}y${reset}/${bold}${red}n${reset})? "
read Database
DatabaseToolList=(
kafkacat
)
CaskDatabaseToolList=(
pgadmin4
studio-3t
graphiql
azure-data-studio
)
if [ "$Database" != "${Database#[Yy]}" ] ;then
echo Yes
brew install ${DatabaseToolList[@]}
brew install --cask ${CaskDatabaseToolList[@]}
else
echo No
fi
############# IDEs #############
beginDeploy "############# IDEs #############"
echo -n "Do you wish to install IDEs (${bold}${green}y${reset}/${bold}${red}n${reset})? "
read IDEs
CaskIDEsList=(
visual-studio-code
intellij-idea
visual-studio
android-studio
)
if [ "$IDEs" != "${IDEs#[Yy]}" ] ;then
echo Yes
brew install --cask --appdir="/Applications" ${CaskIDEsList[@]}
cat vscode-extensions.txt | xargs -L1 code --install-extension
else
echo No
fi
############# DevOps #############
beginDeploy "############# DevOps #############"
echo -n "Do you wish to install DevOps Tools (${bold}${green}y${reset}/${bold}${red}n${reset})? "
read DevOps
DevOpsToolList=(
terraform
vault
consul
nomad
packer
terragrunt
ansible
awscli
aws-sam-cli
kompose
)
CaskDevOpsToolList=(
vagrant
vmware-fusion
virtualbox
docker
vagrant-manager
)
if [ "$DevOps" != "${DevOps#[Yy]}" ] ;then
echo Yes
brew install ${DevOpsToolList[@]}
brew install --cask ${CaskDevOpsToolList[@]}
## DOCKER APP
wget -P ~/Downloads/ https://github.com/docker/app/releases/download/v0.6.0/docker-app-darwin.tar.gz
tar -xvf ~/Downloads/docker-app-darwin.tar.gz -C ~/Downloads/
mv ~/Downloads/docker-app-darwin /usr/local/bin/docker-app
rm ~/Downloads/docker-app-darwin.tar.gz
## Install AWS CLI
#pip3 --version
#curl -O https://bootstrap.pypa.io/get-pip.py
#python3 get-pip.py --user
#pip3 install awscli --upgrade --user
aws --version
#rm get-pip.py
curl "https://d1vvhvl2y92vvt.cloudfront.net/awscli-exe-macos.zip" -o "awscliv2.zip"
unzip awscliv2.zip
sudo ./aws/install
aws2 --version
else
echo No
fi
############# Productivity Tools #############
beginDeploy "############# Productivity Tools #############"
echo -n "Do you wish to install Productivity Tools (${bold}${green}y${reset}/${bold}${red}n${reset})? "
read Productivity
CaskProductivityToolList=(
slack
evernote
the-unarchiver
dash
gpg-suite
microsoft-teams
microsoft-office
zoomus
)
if [ "$Productivity" != "${Productivity#[Yy]}" ] ;then
echo Yes
brew install --cask --appdir="/Applications" ${CaskProductivityToolList[@]}
else
echo No
fi
############# Mac Application #############
beginDeploy "############# Mac Application #############"
echo -n "Do you wish to install Mac Application (${bold}${green}y${reset}/${bold}${red}n${reset})? "
read MacApplication
MacApplicationToolList=(
409183694 # Keynote
409203825 # Numbers
409201541 # Pages
497799835 # Xcode
1450874784 # Transporter
1274495053 # Microsoft To Do
1295203466 # Microsoft Remote Desktop 10
985367838 # Microsoft Outlook
)
if [ "$MacApplication" != "${MacApplication#[Yy]}" ] ;then
brew install mas
mas install ${MacApplicationToolList[@]}
echo "######### Save screenshots to ${HOME}/Pictures/Screenshots"
defaults write com.apple.screencapture location -string "${HOME}/Pictures/Screenshots"
echo "######### Save screenshots in PNG format (other options: BMP, GIF, JPG, PDF, TIFF"
defaults write com.apple.screencapture type -string "png"
else
echo No
fi
beginDeploy "############# CLEANING HOMEBREW #############"
brew cleanup
beginDeploy "############# GLOBAL GIT CONFIG #############"
sh -c 'curl -s https://raw.githubusercontent.com/maxyermayank/developer-mac-setup/master/.gitignore >> ~/.gitignore'
git config --global push.default current
git config --global core.excludesfile ~/.gitignore
git config --global user.name "<username>"
git config --global user.email <email>
git config --global color.branch auto
git config --global color.diff auto
git config --global color.interactive auto
git config --global color.status auto
beginDeploy "############# ALIASES #############"
beginDeploy "############# GIT ALIASES #############"
sh -c 'curl -s https://raw.githubusercontent.com/maxyermayank/developer-mac-setup/master/.git_aliases >> ~/.git_aliases'
source ~/.git_aliases
beginDeploy "############# DOCKER ALIASES #############"
sh -c 'curl -s https://raw.githubusercontent.com/maxyermayank/developer-mac-setup/master/.docker_aliases >> ~/.docker_aliases'
source ~/.docker_aliases
beginDeploy "############# K8s ALIASES #############"
sh -c 'curl -s https://raw.githubusercontent.com/maxyermayank/developer-mac-setup/master/.kubectl_aliases >> ~/.kubectl_aliases'
source ~/.kubectl_aliases
beginDeploy "############# SETUP BASH PROFILE #############"
source ~/.bash_profile
runtime=$((($(date +%s)-$start)/60))
beginDeploy "############# Total Setup Time ############# $runtime Minutes"