-
Notifications
You must be signed in to change notification settings - Fork 0
/
run.sh
49 lines (38 loc) · 982 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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#!/bin/bash
###########
# PURPOSE #
###########
# Convenient wrapper for running SportDP Helper
# For a list of possible arguments, run
# $ ./run.sh --help
# enable bash strict mode
set -eu
BASEDIR="$( dirname "$0")"
last="${@:$#}" # last parameter
other="${*%${!#}}" # all parameters except the last
if [ -e "$last" ]; then
data="data/scratch/data.xls"
cp "$last" "$BASEDIR/$data"
last="./data/scratch/data.xls"
fi
cd "$BASEDIR"
# prepare graceful exit
function finish {
sudo docker-compose down
}
trap finish EXIT
# build
sudo docker-compose build
# start selenium
sudo docker-compose up --detach selenium
echo "Waiting for selenium to fully start..."
sleep 10
# start vnc (ignore errors)
echo "Starting vnc client (errors will be ignored)"
vinagre 127.0.0.1:5901 2>/dev/null || true &
# run sportdb-helper
sudo docker-compose run \
--rm \
--name sportdb-helper-container \
-v $(pwd)/data:/sportdb-helper/data \
sportdb-helper $last $other