-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall-requirements.sh
executable file
·243 lines (162 loc) · 5.66 KB
/
install-requirements.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
#!/bin/bash
###################################################
echo "--------------------------------------------"
echo "----- Checking Git -------------------------"
echo "--------------------------------------------"
git --version
res=$?
if [ $res -ne 0 ]; then
echo "----- Git is not installed -----------------"
echo "----- Installing Git -----------------------"
set -x
sudo apt-get install git
git --version
set +x
fi
echo "--------------------------------------------"
echo "Git already installed"
echo ""
###################################################
echo "--------------------------------------------"
echo "----- Checking cURL ------------------------"
echo "--------------------------------------------"
curl --version
res=$?
if [ $res -ne 0 ]; then
echo "----- cURL is not installed ----------------"
echo "----- Installing cURL ----------------------"
set -x
sudo apt-get install curl
curl --version
set +x
fi
echo "--------------------------------------------"
echo "cURL already installed"
echo ""
###################################################
echo "--------------------------------------------"
echo "----- Checking Docker ----------------------"
echo "--------------------------------------------"
docker --version
res=$?
if [ $res -ne 0 ]; then
echo "----- Docker is not installed --------------"
echo "----- Installing Docker --------------------"
set -x
sudo apt-get update
sudo apt-get install \
ca-certificates \
curl \
gnupg
sudo mkdir -m 0755 -p /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
echo \
"deb [arch="$(dpkg --print-architecture)" signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \
"$(. /etc/os-release && echo "$VERSION_CODENAME")" stable" | \
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get update
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
sudo groupadd docker
sudo usermod -aG docker $USER
docker --version
set +x
fi
echo "--------------------------------------------"
echo "Docker already installed"
echo ""
###################################################
echo "--------------------------------------------"
echo "----- Checking Docker Compose --------------"
echo "--------------------------------------------"
docker-compose --version
res=$?
if [ $res -ne 0 ]; then
echo "----- Docker Compose is not installed ------"
echo "----- Installing Docker Compose ------------"
set -x
sudo curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
docker-compose --version
set +x
fi
echo "--------------------------------------------"
echo "Docker Compose already installed"
echo ""
###################################################
echo "--------------------------------------------"
echo "----- Checking Golang ----------------------"
echo "--------------------------------------------"
go version
res=$?
if [ $res -ne 0 ]; then
echo "----- Golang is not installed --------------"
echo "----- Installing Golang --------------------"
set -x
pushd $HOME
VERSION="1.20.2" # go version
ARCH="amd64" # go archicture
curl -O -L "https://golang.org/dl/go${VERSION}.linux-${ARCH}.tar.gz"
curl -sL https://golang.org/dl/ | grep -A 5 -w "go${VERSION}.linux-${ARCH}.tar.gz"curl -sL https://golang.org/dl/ | grep -A 5 -w "go${VERSION}.linux-${ARCH}.tar.gz"
tar -xf "go${VERSION}.linux-${ARCH}.tar.gz"
sudo chown -R root:root ./go
sudo mv -v go /usr/local
echo "# Set up Go path #" >> ~/.bashrc
echo "export GOPATH=$HOME/go" >> ~/.bashrc
echo "export PATH=$PATH:/usr/local/go/bin:$GOPATH/bin" >> ~/.bashrc
popd
go version
set +x
fi
echo "--------------------------------------------"
echo "Golang already installed"
echo ""
###################################################
echo "--------------------------------------------"
echo "----- Checking Node ------------------------"
echo "--------------------------------------------"
node --version
res=$?
if [ $res -ne 0 ]; then
echo "----- Node is not installed ----------------"
echo "----- Installing Node ----------------------"
set -x
curl -fsSL https://deb.nodesource.com/setup_19.x | sudo -E bash - &&\
sudo apt-get install -y nodejs
node --version
set +x
fi
echo "--------------------------------------------"
echo "Node already installed"
echo ""
###################################################
echo "--------------------------------------------"
echo "----- Checking npm -------------------------"
echo "--------------------------------------------"
npm --version
res=$?
if [ $res -ne 0 ]; then
echo "----- npm is not installed -----------------"
fi
echo "--------------------------------------------"
echo "npm already installed"
echo ""
###################################################
# echo "--------------------------------------------"
# echo "----- Checking Python ----------------------"
# echo "--------------------------------------------"
# python --version
# res=$?
# if [ $res -ne 0 ]; then
# echo "----- Pyhton is not installed --------------"
# echo "----- Installing Python --------------------"
# set -x
# sudo apt-get install python3
# sudo apt-get install python-is-python3
# python --version
# set +x
# fi
# echo "--------------------------------------------"
# echo "Python already installed"
# echo ""
###################################################
echo "--------------------------------------------"