-
Notifications
You must be signed in to change notification settings - Fork 0
/
Install_Apps_on_Mac_Old.sh
196 lines (162 loc) · 5.68 KB
/
Install_Apps_on_Mac_Old.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
#!/bin/sh
#################################################################################################################################
# Name: Install_Apps_on_Mac.sh #
# Purpose: Installing Development Applications on Mac OS #
# Author: Ranga Reddy #
# Created Date: 27-Sep-2020 #
# Version: v1.0 #
# #
#################################################################################################################################
echo ""
echo "Installing Applications"
HOMEBREW_URL='https://raw.githubusercontent.com/Homebrew/install/master/install'
JAVA_HOME_PATH="/Library/Java/JavaVirtualMachines/adoptopenjdk-8.jdk/Contents/Home"
command_exists () {
type "$1" &> /dev/null ;
}
# brew
if ! command_exists brew ; then
echo "Installing HomeBrew..."
# supress the need to press 'return' when in the install script runs.
yes '' | /bin/bash -c "$(curl -fsSL $HOMEBREW_URL)"
fi
if ! command_exists brew ; then
echo "Brew not installed... exiting"
exit 0
fi
brew update
# telnet
if ! command_exists telnet ; then
echo "Installing telnet..."
brew install telnet
fi
# git version tool
if ! command_exists git ; then
echo "Installing git..."
brew install git
fi
# wget
if ! command_exists wget ; then
echo "Installing wget..."
brew install wget
fi
# jq
if ! command_exists jq ; then
brew install jq
fi
# visual studio
if ! command_exists code ; then
echo "Installing Visual Studio code..."
brew cask install --appdir='/Applications' 'visual-studio-code'
fi
# java8
checkAndInstallJava() {
source ~/.bash_profile;
if [ -z "$JAVA_HOME" ]; then
if [ ! -d "$JAVA_HOME_PATH" ]; then
echo "Installing OpenJDK8..."
brew cask install adoptopenjdk8
fi
echo "Exporting the JAVA_HOME=$JAVA_HOME_PATH to .bash_profile"
echo "export JAVA_HOME=$JAVA_HOME_PATH" >> ~/.bash_profile;
echo "export PATH=\$JAVA_HOME/bin:\$PATH" >> ~/.bash_profile;
source ~/.bash_profile;
echo "Verifying JAVA_HOME path"
echo $JAVA_HOME
fi
}
checkAndInstallJava
# scala
if ! command_exists scala ; then
echo "Installing Scala"
brew install '[email protected]'
source ~/.bash_profile;
if [ -z "$SCALA_HOME" ]; then
SCALA_HOME_DIR=(/usr/local/Cellar/scala*/*)
echo "Exporting the SCALA_HOME=$SCALA_HOME_DIR to .bash_profile"
echo "export SCALA_HOME=$SCALA_HOME_DIR" >> ~/.bash_profile
echo "export PATH=\$SCALA_HOME/bin:\$PATH" >> ~/.bash_profile
source ~/.bash_profile
echo "Verifying SCALA_HOME path"
echo $SCALA_HOME
fi
fi
# maven
if ! command_exists mvn ; then
echo "Installing Maven build tool"
brew install 'maven'
MAVEN_HOME=`mvn --version | grep 'Maven home:' | cut -d ':' -f 2 | cut -d ' ' -f 2`
source ~/.bash_profile;
if [ -z "$M2_HOME" ]; then
echo "export M2_HOME=$MAVEN_HOME" >> ~/.bash_profile;
echo "export PATH=\$M2_HOME/bin:\$PATH" >> ~/.bash_profile;
fi
cp $MAVEN_HOME/conf/settings.xml ~/.m2/
fi
## gradle
if ! command_exists gradle ; then
echo "Installing Gradle build tool"
brew install gradle
GRADLE_VERSION=`gradle --version | grep 'Gradle ' | cut -d ' ' -f 2`
GRADLE_HOME_DIR='/usr/local/Cellar/gradle/$GRADLE_VERSION/'
if [ -z "$GRADLE_HOME" ]; then
echo "export GRADLE_HOME=$GRADLE_HOME_DIR" >> ~/.bash_profile;
echo "export PATH=\$GRADLE_HOME/bin:\$PATH" >> ~/.bash_profile;
fi
fi
# sbt
if ! command_exists sbt ; then
echo "Installing sbt build tool"
brew install sbt
fi
# intellij idea
if ! command_exists idea ; then
echo "Installing IntelliJ Community Edition..."
brew cask install --appdir='/Applications' 'intellij-idea-ce'
sudo ln -s "/Applications/IntelliJ\ IDEA\ CE.app/Contents/MacOS/idea" /usr/local/bin/idea
fi
# sublime text editor
if ! command_exists subl ; then
echo "Installing Sublime text..."
brew cask install --appdir='/Applications' 'sublime-text'
fi
# mysql --> username root and password root
if ! command_exists mysql ; then
echo "Installing MySQL..."
brew install [email protected]
echo 'export PATH="/usr/local/opt/[email protected]/bin:$PATH"' >> ~/.bash_profile
source ~/.bash_profile;
brew services start [email protected]
/usr/local/opt/[email protected]/bin/mysqladmin -u root password 'root'
fi
# docker
if ! command_exists docker ; then
brew install --cask --appdir='/Applications' 'docker'
brew install docker-compose
brew link --overwrite docker-compose
fi
# virtualbox
if ! command_exists virtualbox ; then
brew install virtualbox
if ! command_exists virtualbox ; then
echo "To install and/or use virtualbox you may need to enable its kernel extension in: System Preferences → Security & Privacy → General"
exit 1
fi
fi
# docker-machine
if ! command_exists docker-machine ; then
brew install docker-machine
docker-machine create --driver virtualbox default
docker-machine env default
eval $(docker-machine env default)
docker-machine stop default
fi
# kubectl
if ! command_exists kubectl ; then
brew install kubectl
fi
# minikube
if ! command_exists minikube ; then
brew install minikube
fi
echo "Applications installed successfully"