-
Notifications
You must be signed in to change notification settings - Fork 0
/
development.sh
executable file
·97 lines (73 loc) · 1.25 KB
/
development.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
#!/usr/bin/env bash
set -eo pipefail
# allow running from any working directory
WD=$(dirname "$0")
cd "${WD}"
# initialize package folder
mkdir -p ./docker
DOCKER_COMPOSE_CMD="docker compose -f ./docker/docker-compose.yml -f ./docker/docker-compose.custom.yml"
function check_docker {
curl https://raw.githubusercontent.com/HSLdevcom/jore4-tools/main/docker/download-docker-bundle.sh | bash
}
function start {
check_docker
$DOCKER_COMPOSE_CMD up --build -d jore4-auth jore4-testdb
}
function stop_all {
check_docker
$DOCKER_COMPOSE_CMD stop
}
function remove_all {
check_docker
$DOCKER_COMPOSE_CMD down
}
function build {
mvn install
}
function run_tests {
mvn test
}
function usage {
echo "
Usage $(basename $0) <command>
build
Build the project locally
start
Start auth service and testdb in Docker container
stop
Stop auth Docker containers
remove
Stop and remove auth Docker containers
test
Run tests locally
help
Show this usage information
"
}
if [[ -z ${1} ]]; then
usage
else
case $1 in
start)
start
;;
stop)
stop_all
;;
remove)
remove_all
;;
help)
usage
;;
build)
build
;;
test)
run_tests
;;
*)
usage
;;
esac
fi