-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathrun.sh
executable file
·35 lines (28 loc) · 846 Bytes
/
run.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
#!/usr/bin/env bash
# Elevate privileges
[ $UID -eq 0 ] || exec sudo --preserve-env=VERSION bash "$0" "$@"
. settings.sh
. ../../lib/lib.sh
. lib.sh
check_containers "$REQUIRED_CONTAINERS" || exit 1
$MYSQL --execute="USE $DB_DATABASE;"
readonly USE_DB_RETCODE=$?
# Exit immediately if a pipeline, which may consist of a single simple command,
# a list, or a compound command returns a non-zero status
set -e
if [ "$USE_DB_RETCODE" -ne 0 ]; then
readonly FIRST_RUN=true
initialize_database
fi
run
wait_for_all_container_ports $CONTAINER_NAME $WAIT_TIMEOUT
if [ "$FIRST_RUN" == "true" ]; then
initialize_jasperreports_1
fi
docker restart $CONTAINER_NAME
wait_for_all_container_ports $CONTAINER_NAME $WAIT_TIMEOUT
if [ "$FIRST_RUN" == "true" ]; then
warm_up_webapp
initialize_jasperreports_2
fi
print_container_info $CONTAINER_NAME