forked from triplea-game/triplea
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathverify
executable file
·55 lines (47 loc) · 1.42 KB
/
verify
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
#!/bin/bash
# This script runs all checks across the entire project.
# Checks if a dependency is installed on a system.
function checkDependency {
local depName="$1"
if hash "$depName"; then
return 0
else
echo "ERROR: dependency not installed '$depName'"
if [ "$(uname)" == "Darwin" ]; then
echo "Follow these steps to install docker: https://store.docker.com/editions/community/docker-ce-desktop-mac"
exit 1
fi
return 1
fi
}
# Installs python
# Installs docker & docker-compose using pip
# Adds current user to 'docker' group (allows for sudo-less docker)
function installDocker {
echo "Installing python and pip, a dependency of docker"
if hash yum; then
set -x
sudo yum update -y
sudo yum install -y python3 python3-pip
set +x
else
set -x
sudo apt install -y python3 python3-pip
set +x
fi
echo "Installing Docker (with pip)"
set -x
pip3 install docker docker-compose
set +x
echo "Adding current user: $USER to group: 'docker' (allows sudo-less docker)."
echo "Log back in for these changes to take effect."
groups | grep -q "docker" || sudo usermod -a -G docker "$USER"
}
scriptDir="$(dirname $0)"
set -o pipefail
set -eu
checkDependency "docker" || installDocker
"$scriptDir/.build/setup-database"
"$scriptDir/gradlew" check $@
"$scriptDir/.build/find-unused-dbunit-datasets"
"$scriptDir/.build/code-convention-checks/check-custom-style" spitfire-server