-
Notifications
You must be signed in to change notification settings - Fork 3
/
start-it-with-local-env.sh
executable file
·76 lines (66 loc) · 1.61 KB
/
start-it-with-local-env.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
#!/bin/sh
#
# SPDX-FileCopyrightText: 2024 Lifely
# SPDX-License-Identifier: EUPL-1.2+
#
set -e
help() {
echo "Starts the integration tests with a local ZAC Docker Image."
echo
echo "Syntax: $0 [-b|d|v|u|r|h]"
echo "options:"
echo "-b Build a local ZAC Docker image"
echo "-d Delete local Docker volume data before starting Docker Compose"
echo "-v Keep local Docker Compose volume data after test execution"
echo "-u Turn on debug logs"
echo "-r Re-run successful tasks"
echo "-h Print this Help"
echo
}
echoerr() {
echo 1>&2;
echo "$@" 1>&2;
echo 1>&2;
}
volumeDataFolder="./scripts/docker-compose/volume-data"
args=""
[ -f fix-permissions.sh ] && ./fix-permissions.sh
build=false
while getopts ':bdvurh' OPTION; do
case "$OPTION" in
b)
build=true
;;
d)
echo "Deleting local Docker volume data folder: '$volumeDataFolder'.."
rm -rf $volumeDataFolder
echo "Done"
;;
v)
export REMOVE_DOCKER_COMPOSE_VOLUMES=false
;;
u)
echo "Turning on debug logs ..."
args="$args -Si -Dorg.gradle.vfs.watch=true"
;;
r)
echo "Re-running tasks ..."
args="$args --rerun-tasks"
;;
h)
help
exit;;
\?)
echoerr "Error: Invalid option $OPTION"
help
exit;;
esac
done
if [ $build = "true" ]; then
echo "Building ZAC Docker Image ..."
./gradlew buildDockerImage
fi
export ZAC_DOCKER_IMAGE=ghcr.io/infonl/zaakafhandelcomponent:dev
[ -f check-for-running-containers.sh ] && ./check-for-running-containers.sh
# shellcheck disable=SC2086
./gradlew $args itest