-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathingredient-list.sh
415 lines (360 loc) · 13.3 KB
/
ingredient-list.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
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
#!/bin/bash
# -------------------- Mac OS ingredients -----------------------
install_jenv_macos() {
printf "${LIGHT_BLUE} --> Installing jenv${NC}\n"
brew install jenv
echo 'export PATH="$HOME/.jenv/bin:$PATH"' >> ~/.bashrc
echo 'eval "$(jenv init -)"' >> ~/.bashrc
printf "${GREEN} :: Configure JVM in jenv --> 'jenv add /path/to/java/home'${NC}\n"
printf "${GREEN} :: Configure which JVM to use --> 'jenv global oracle-1.7.0' or 'jenv local oracle-1.7.0' or 'jenv shell oracle-1.7.0'${NC}\n"
source ~/.bashrc
}
install_java_macos() {
printf "${LIGHT_BLUE} --> Installing Java 8${NC}\n"
brew tap caskroom/versions 2>/dev/null
brew install --cask java8
}
install_maven_macos() {
printf "${LIGHT_BLUE} --> Installing Maven${NC}\n"
brew update
brew install maven
}
install_gradle_macos() {
printf "${LIGHT_BLUE} --> Installing Gradle${NC}\n"
brew update
brew install gradle
}
install_miniconda_macos() {
if [ -d "$HOME/miniconda" ] || [ -d "$HOME/miniconda3" ] || [ -d "$HOME/.miniconda" ] || [ -d "$HOME/.miniconda3" ]; then
printf "${YELLOW} ~~> Miniconda folder discovered! Try restarting terminal session${NC}\n"
else
printf "${LIGHT_BLUE} --> Installing Miniconda${NC}\n"
wget http://repo.continuum.io/miniconda/Miniconda3-3.7.0-Linux-x86_64.sh -O ~/miniconda.sh
bash ~/miniconda.sh -b -p $HOME/miniconda
echo "export PATH=$HOME/miniconda/bin:$PATH" >> ~/.bash_profile
fi
}
install_python_macos() {
printf "${LIGHT_BLUE} --> Installing Python${NC}\n"
brew update
brew install python
}
install_rbenv_macos() {
printf "${LIGHT_BLUE} --> Installing rbenv${NC}\n"
brew update
brew install rbenv
sudo rbenv init
curl -fsSL https://github.com/rbenv/rbenv-installer/raw/master/bin/rbenv-doctor | bash
}
install_ruby_macos() {
printf "${LIGHT_BLUE} --> Installing Ruby${NC}\n"
brew update
brew install ruby
}
install_git_macos() {
printf "${LIGHT_BLUE} --> Installing Git${NC}\n"
brew update
brew install git
}
install_wget_macos() {
printf "${LIGHT_BLUE} --> Installing wget${NC}\n"
brew update
brew install wget
}
install_vim_macos() {
printf "${LIGHT_BLUE} --> Installing Vim${NC}\n"
brew update
brew install vim
}
install_docker_macos() {
printf "${LIGHT_BLUE} --> Loading Docker${NC}\n"
wget https://download.docker.com/mac/stable/Docker.dmg 2>/dev/null &
spinnerComplex
printf "${YELLOW} ~~> To install Docker, manually run Docker.dmg file, which could be found in 'preflight-check' folder${NC}\n"
}
install_vagrant_macos() {
printf "${LIGHT_BLUE} --> Installing Vagrant${NC}\n"
brew install --cask virtualbox
brew install --cask vagrant
}
install_chef_macos() {
printf "${LIGHT_BLUE} --> Loading Chef-client${NC}\n"
wget https://packages.chef.io/files/stable/chef/13.6.4/mac_os_x/10.13/chef-13.6.4-1.dmg 2>/dev/null &
spinnerComplex
printf "${YELLOW} ~~> To install ChefSDK, manually run chef-13.6.4-1.dmg file, which could be found in 'preflight-check' folder${NC}\n"
}
install_smcfancontrol_macos() {
printf "${LIGHT_BLUE} --> Installing smcfancontrol${NC}\n"
brew install --cask smcfancontrol
}
install_iterm_macos() {
printf "${LIGHT_BLUE} --> Downloading iTerm${NC}\n"
wget https://iterm2.com/downloads/stable/iTerm2-3_1_5.zip 2>/dev/null &
spinnerComplex
printf "${YELLOW} ~~> To install iTerm, manually run iTerm2-3_1_5.zip file, which could be found in 'preflight-check' folder${NC}\n"
}
install_homebrew_macos() {
printf "${LIGHT_BLUE} --> Installing Homebrew${NC}\n"
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
}
install_adshell_macos() {
printf "${LIGHT_BLUE} --> Installing Adshell${NC}\n"
git clone https://github.com/AdamWhittingham/adshell --recursive ~/.adshell && ~/.adshell/install
# Need to sort out ~/.bashrc ~/.bash_profile settings
}
# -------------------- GNU/Linux ingredients --------------------
install_jenv_linux() {
printf "${LIGHT_BLUE} --> Installing jenv${NC}\n"
git clone https://github.com/gcuisinier/jenv.git ~/.jenv
echo 'export PATH="$HOME/.jenv/bin:$PATH"' >> ~/.bash_profile
echo 'eval "$(jenv init -)"' >> ~/.bash_profile
printf "${GREEN} :: Configure JVM in jenv --> 'jenv add /path/to/java/home'${NC}\n"
printf "${GREEN} :: Configure which JVM to use --> 'jenv global oracle-1.7.0' or 'jenv local oracle-1.7.0' or 'jenv shell oracle-1.7.0'${NC}\n"
source ~/.bash_profile
}
install_java_linux() {
printf "${LIGHT_BLUE} --> Installing Java 8${NC}\n"
sudo apt-get update
sudo apt-get install openjdk-8-jre
sudo apt-get install openjdk-8-jdk
echo "export JAVA_HOME=/usr/lib/jvm/java-8-openjdk" >> ~/.bashrc
echo "export PATH=$PATH:$JAVA_HOME" >> ~/.bashrc
}
install_maven_linux() {
printf "${LIGHT_BLUE} --> Installing Maven${NC}\n"
sudoapt-get update
sudo apt-get install maven
echo "export M2_HOME=/usr/local/apache-maven" >> ~/.bashrc
echo "export M2=$M2_HOME/bin" >> ~/.bashrc
echo "export PATH=$M2:$PATH" >> ~/.bashrc
source ~/.bashrc
}
install_git_linux() {
printf "${LIGHT_BLUE} --> Installing Git${NC}\n"
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install git
}
install_wget_linux() {
printf "${LIGHT_BLUE} --> Installing wget${NC}\n"
sudo apt-get install wget
}
install_vim_linux() {
printf "${LIGHT_BLUE} --> Installing Vim${NC}\n"
sudo add-apt-repository ppa:jonathonf/vim
sudo apt update
sudo apt install vim
}
install_rbenv_linux() {
printf "${LIGHT_BLUE} --> Installing rbenv${NC}\n"
sudo apt-get update
sudo apt-get install autoconf bison build-essential libssl-dev libyaml-dev libreadline6-dev zlib1g-dev libncurses5-dev libffi-dev libgdbm3 libgdbm-dev
git clone https://github.com/rbenv/rbenv.git ~/.rbenv
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc
echo 'eval "$(rbenv init -)"' >> ~/.bashrc
source ~/.bashrc
git clone https://github.com/rbenv/ruby-build.git ~/.rbenv/plugins/ruby-build
curl -fsSL https://github.com/rbenv/rbenv-installer/raw/master/bin/rbenv-doctor | bash
if type -p ruby; then
echo ""
else
printf "${YELLOW} --> As you installed rbenv, you can install Ruby right now${NC}\n"
while true; do
read -p " ~~> Do you wish to install {Ruby}? [Yes/No] " yn
case $yn in
[Yy]* )
rbenv install -v 2.3.1
rbenv global 2.3.1
break
;;
[Nn]* )
printf "${YELLOW} ~~> Skipping installation${NC}\n"
break
;;
* )
echo "Please answer yes or no\n"
;;
esac
done
fi
}
install_ruby_linux() {
printf "${LIGHT_BLUE} --> Installing Ruby${NC}\n"
sudo apt-get install ruby-full
}
install_docker_linux() {
printf "${LIGHT_BLUE} --> Installing Docker-CE${NC}\n"
sudo apt-get update
sudo apt-get install apt-transport-https ca-certificates curl software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
sudo apt-get update
sudo apt-get install docker-ce
}
install_vagrant_linux() {
printf "${LIGHT_BLUE} --> Installing Vagrant${NC}\n"
sudo apt-get install virtualbox
sudo apt-get install vagrant
}
# -------------------- RedHat/Centos ingredients -----------------------
install_jenv_redhat() {
printf "${LIGHT_BLUE} --> Installing jenv${NC}\n"
git clone https://github.com/gcuisinier/jenv.git ~/.jenv
echo 'export PATH="$HOME/.jenv/bin:$PATH"' >> ~/.bashrc
echo 'eval "$(jenv init -)"' >> ~/.bashrc
printf "${GREEN} :: Configure JVM in jenv --> 'jenv add /path/to/java/home'${NC}\n"
printf "${GREEN} :: Configure which JVM to use --> 'jenv global oracle-1.7.0' or 'jenv local oracle-1.7.0' or 'jenv shell oracle-1.7.0'${NC}\n"
source ~/.bashrc
}
install_java_redhat() {
printf "${LIGHT_BLUE} --> Installing Java 8${NC}\n"
sudo yum update
sudo yum install java-1.8.0-openjdk-devel
}
install_maven_redhat() {
printf "${LIGHT_BLUE} --> Installing Maven${NC}\n"
wget http://mirror.olnevhost.net/pub/apache/maven/maven-3/3.5.2/binaries/apache-maven-3.5.2-bin.tar.gz
tar xvf apache-maven-3.5.2-bin.tar.gz
sudo mv apache-maven-3.5.2 /usr/local/maven
echo "export M2_HOME=/usr/local/maven" >> ~/.bashrc
echo "export M2=${M2_HOME}/bin" >> ~/.bashrc
echo "export PATH=${M2}:${PATH}" >> ~/.bashrc
rm -r apache-maven-3.5.2-bin.tar.gz
if [[ -d apache-maven-3.5.2 ]]; then
rm -r apache-maven-3.5.2
fi
source ~/.bashrc
}
install_git_redhat() {
printf "${LIGHT_BLUE} --> Installing Git${NC}\n"
sudo yum install git
}
install_wget_redhat() {
printf "${LIGHT_BLUE} --> Installing wget${NC}\n"
sudo yum install wget
}
install_vim_redhat() {
printf "${LIGHT_BLUE} --> Installing Vim${NC}\n"
sudo yum install gcc git ncurses-devel
git clone https://github.com/vim/vim.git
sudo mv vim ~/.vim
cd ~/.vim/src
sudo make
sudo make install
}
install_rbenv_redhat() {
printf "${LIGHT_BLUE} --> Installing rbenv${NC}\n"
sudo yum install -y git-core zlib zlib-devel gcc-c++ patch readline readline-devel libyaml-devel libffi-devel openssl-devel make bzip2 autoconf automake libtool bison curl sqlite-devel
cd ~/
git clone git://github.com/sstephenson/rbenv.git .rbenv
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc
echo 'eval "$(rbenv init -)"' >> ~/.bashrc
git clone git://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build
echo 'export PATH="$HOME/.rbenv/plugins/ruby-build/bin:$PATH"' >> ~/.bashrc
source ~/.bashrc
curl -fsSL https://github.com/rbenv/rbenv-installer/raw/master/bin/rbenv-doctor | bash
if type -p ruby; then
echo ""
else
printf "${YELLOW} --> As you installed rbenv, you can install Ruby right now${NC}\n"
while true; do
read -p " ~~> Do you wish to install {Ruby}? [Yes/No] " yn
case $yn in
[Yy]* )
rbenv install -v 2.3.1
rbenv global 2.3.1
break
;;
[Nn]* )
printf "${YELLOW} ~~> Skipping installation${NC}\n"
break
;;
* )
echo "Please answer yes or no\n"
;;
esac
done
fi
}
install_ruby_redhat() {
printf "${LIGHT_BLUE} --> Installing Ruby${NC}\n"
sudo yum install ruby
}
install_docker_redhat() {
printf "${LIGHT_BLUE} --> Installing Docker-CE${NC}\n"
sudo yum install -y yum-utils device-mapper-persistent-data lvm2
sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
sudo yum install docker-ce
}
install_vagrant_redhat() {
printf "${LIGHT_BLUE} --> Installing Vagrant${NC}\n"
sudo yum -y install gcc dkms make qt libgomp patch
sudo yum -y install kernel-headers kernel-devel binutils glibc-headers glibc-devel font-forge
sudo yum-config-manager --add-repo http://download.virtualbox.org/virtualbox/rpm/rhel/virtualbox.repo
sudo yum install -y VirtualBox-5.1
sudo yum -y install https://releases.hashicorp.com/vagrant/1.9.6/vagrant_1.9.6_i686.rpm
}
# -------------------- Shared ingredients -----------------------
install_bundler() {
printf "${LIGHT_BLUE} --> Installing Bundler${NC}\n"
gem install bundler
}
install_rails() {
printf "${LIGHT_BLUE} --> Installing Ruby-on-Rails${NC}\n"
gem install rails -v 5.1.4
}
install_adshell() {
printf "${LIGHT_BLUE} --> Installing Adshell${NC}\n"
git clone https://github.com/AdamWhittingham/adshell --recursive ~/.adshell && ~/.adshell/install
}
install_nicer_vim_config() {
printf "${LIGHT_BLUE} --> Installing nicer Vim config${NC}\n"
git clone https://github.com/AdamWhittingham/vim-config.git ~/.vim && ~/.vim/install
}
install_miniconda() {
if [ "$(getconf LONG_BIT)" == "64" ]; then
if [ -d "$HOME/miniconda" ] || [ -d "$HOME/miniconda3" ] || [ -d "$HOME/.miniconda" ] || [ -d "$HOME/.miniconda3" ]; then
printf "${YELLOW} ~~> Miniconda folder discovered! Try restarting terminal session${NC}\n"
else
printf "${LIGHT_BLUE} --> Installing Miniconda 64bit${NC}\n"
wget https://repo.continuum.io/miniconda/Miniconda2-latest-Linux-x86_64.sh && bash Miniconda2-latest-Linux-x86_64.sh
sudo rm Miniconda2-latest-Linux-x86_64.sh
fi
else
if [ -d "$HOME/miniconda" ] || [ -d "$HOME/miniconda3" ] || [ -d "$HOME/.miniconda" ] || [ -d "$HOME/.miniconda3" ]; then
printf "${YELLOW} ~~> Miniconda folder discovered! Try restarting terminal session${NC}\n"
else
printf "${LIGHT_BLUE} --> Installing Miniconda 32bit${NC}\n"
wget https://repo.continuum.io/miniconda/Miniconda2-latest-Linux-x86.sh && bash Miniconda2-latest-Linux-x86.sh
sudo rm Miniconda2-latest-Linux-x86.sh
fi
fi
}
install_chef() {
printf "${LIGHT_BLUE} --> Installing Chef-client${NC}\n"
curl -L https://www.opscode.com/chef/install.sh | sudo bash
}
install_gradle_linux_redhat() {
wget https://services.gradle.org/distributions/gradle-4.5.1-bin.zip
mkdir -p /opt/gradle
unzip -d /opt/gradle gradle-4.5.1-bin.zip
rm -f gradle-4.5.1-bin.zip
export PATH=$PATH:/opt/gradle/gradle-4.5.1/bin
}
install_rust() {
curl https://sh.rustup.rs -sSf | sh
}
# -------------------- Sugar ------------------------------------
spinnerComplex() {
local pid=$!
local delay=0.1
local spinstr='|/-\'
while [ "$(ps a | awk '{print $1}' | grep $pid)" ]; do
local temp=${spinstr#?}
printf " [%c] " "$spinstr"
local spinstr=$temp${spinstr%"$temp"}
sleep $delay
printf "\b\b\b\b\b\b"
done
printf " \b\b\b\b"
}