-
Notifications
You must be signed in to change notification settings - Fork 19
/
bang.sh
executable file
·72 lines (57 loc) · 1.27 KB
/
bang.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
#!/bin/sh
set -e
help() {
echo "*** available commands:"
typeset -F | awk 'NF>1{print $NF}' | grep -v 'internal$'
}
clean() {
echo "*** running maven clean..."
mvn clean
}
compile() {
echo "*** running maven install..."
mvn compile
}
test() {
echo "*** running maven test..."
mvn test
}
install() {
echo "*** running maven clean/install..."
mvn clean install
}
install_skip_tests() {
echo "*** running maven clean/install..."
mvn clean install -DskipTests
}
run_jar() {
echo "*** running cantor..."
java -jar cantor-server/target/cantor-server.jar cantor-server/src/main/resources/cantor-server.conf
}
prep_docker_internal() {
echo "*** moving jar to docker folder"
cp cantor-server/target/cantor-server.jar env/dockers/cantor/
}
build_docker() {
prep_docker_internal
echo "*** building cantor docker"
docker build --tag=cantor env/dockers/cantor
}
run_docker() {
echo "*** running cantor in docker container"
docker run -d --publish=7443:7443 --user 7447:7447 --name=cantor cantor
}
kill_docker() {
echo "*** killing cantor docker container"
docker kill cantor ; docker rm -v cantor
}
if [ "$#" = 0 ]
then
install_skip_tests
run_jar
exit
fi
for todo in "$@"
do
$todo
done