-
Notifications
You must be signed in to change notification settings - Fork 5
/
install-reqs.sh
executable file
·70 lines (48 loc) · 1.48 KB
/
install-reqs.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
#!/bin/bash
# Simple function to announce what we're doing
function announce() {
echo ""
echo "#===============================================================#"
echo "# Installing $1"
echo "#===============================================================#"
}
announce "Git"
if ! [ -x "$(command -v git)" ]; then
# Curl is easy
apt install -y curl
else
echo "Skipping, Git already installed!"
fi
announce "Curl"
if ! [ -x "$(command -v curl)" ]; then
# Curl is easy
apt-get install -y curl
else
echo "Skipping, Curl already installed!"
fi
announce "Docker"
if ! [ -x "$(command -v docker)" ]; then
# Docker is a bit complicated
#
# Add the GPG Key
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
# Add the Docker repository to our APT sources
add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
# With those added, update our packages
apt-get update
# Since we're up to date, get docker
apt-get install -y docker-ce
else
echo "Skipping, docker already installed!"
fi
announce "Docker-Compose"
if ! [ -x "$(command -v docker-compose)" ]; then
# Docker-Compose is also complicated
#
# Add the GPG Key
curl -L https://github.com/docker/compose/releases/download/1.18.0/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose
# Make sure it's executable
chmod +x /usr/local/bin/docker-compose
else
echo "Skipping, docker-compose already installed!"
fi