-
Notifications
You must be signed in to change notification settings - Fork 0
/
run.sh
executable file
·63 lines (51 loc) · 1.44 KB
/
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
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
#! /bin/bash
set -x # for debugging only: print out current line before executing it
set -o errexit # abort on nonzero exitstatus
set -o nounset # abort on unbound variable
set -o pipefail # don't hide errors within pipes
COMPOSE_FILE=docker-compose-uncert.yml
read -p "Pull latest state? [y|n] " -n 1 -r
echo # move to a new line
if [[ $REPLY =~ ^[Yy]$ ]]
then
git pull
fi
VOLUME_FLAGS=""
read -p "Remove volumes? [y|n] " -n 1 -r
echo # move to a new line
if [[ $REPLY =~ ^[Yy]$ ]]
then
VOLUME_FLAGS="-v"
fi
RECOMPILE_WRAPPER=false
read -p "Recompile wrapper? [y|n] " -n 1 -r
echo # move to a new line
if [[ $REPLY =~ ^[Yy]$ ]]
then
RECOMPILE_WRAPPER=true
fi
RECOMPILE_FRONTEND=false
read -p "Recompile frontend (required e.g. if server-urls have changed)? [y|n] " -n 1 -r
echo # move to a new line
if [[ $REPLY =~ ^[Yy]$ ]]
then
RECOMPILE_FRONTEND=true
fi
# stop all
if [[ ! -z "$(pidof multilog)" ]]; then
kill -9 $(pidof multilog)
fi
docker compose -f $COMPOSE_FILE down $VOLUME_FLAGS
rm -rf logs/logs/*
# recompile
if [ "$RECOMPILE_WRAPPER" = true ]; then
cd asyncwrapper
docker compose run mvn mvn clean package -DskipTests=true
cd ..
fi
## start
docker compose -f $COMPOSE_FILE up -d
if [ "$RECOMPILE_FRONTEND" = true ]; then
docker compose -f $COMPOSE_FILE up --build --no-deps frontend -d
fi
docker compose -f $COMPOSE_FILE logs --follow --tail 10 | multilog s1048576 n10 ./logs/logs &