-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathIGUANA.sh
73 lines (59 loc) · 1.51 KB
/
IGUANA.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
#!/bin/bash
# Init the volumes
########################
CONFIG="$PWD/config.xml"
QUERIES="$PWD/queries.txt"
RESULTS=$PWD/results
# End of init-volumes
########################
# Init some vars
IMAGE="aksw/dld-present-iguana"
_docker="/usr/bin/docker"
_zenity="/usr/bin/zenity"
DARG=""
# Do some startup checks
#clear
echo "# IGUANA Setup #"
command -v ${_docker} >/dev/null 2>&1 || {
echo >&2 "Please install Docker (http://docker.com/) first!"
if [ ! -t 1 ] ; then
${_zenity} --error --text="Please install Docker (http://docker.com/) first!"
fi
echo "(Press any key to exit...)"
read -rn1
exit 1
}
# Check if our image is present
if ! ${_docker} images | grep aksw/dld-present-iguana ; then
echo "[INFO] Docker-Image $IMAGE does not exist locally. We pull it first:"
#if [ ! -t 1 ] ; then
# ${_zenity} --notification --text="Docker-Image $IMAGE does not exist locally. We pull it first."
#fi
${_docker} pull $IMAGE
fi
if [ -f $CONFIG ]; then
DARG+=" -v $CONFIG:/iguana/config_test.xml"
else
echo "[INFO] No config file given"
fi
if [ -f $QUERIES ]; then
DARG+=" -v $QUERIES:/iguana/queries.txt"
else
echo "[INFO] No queries file given"
fi
if [ -d $RESULTS ]; then
DARG+=" -v $RESULTS:/iguana/results"
else
echo "[INFO] No results dir given"
fi
# Add our image to docker run
DARG+=" $IMAGE:latest"
# Run
echo "# Run Docker-Image $IMAGE:"
${_docker} run $DARG
# Done ;)
if [ ! -t 1 ] ; then
${_zenity} --info --text="Done.\nCheck your results in ${RESULTS}"
fi
echo "(Press any key to exit...)"
read -rn1