Permalink
Newer
100755
38 lines (35 sloc)
1017 Bytes
1
#!/bin/bash
2
3
function normalize_path()
4
{
5
# Remove all /./ sequences.
6
local path=${1//\/.\//\/}
7
8
# Remove dir/.. sequences.
9
while [[ $path =~ ([^/][^/]*/\.\./) ]]
10
do
11
path=${path/${BASH_REMATCH[0]}/}
12
done
13
echo $path
14
}
15
16
cd "$(dirname "$0")"
17
SKIP_DOWNLOAD=0
18
while getopts "nh?" opt; do
19
case $opt in
20
n) SKIP_DOWNLOAD=1 ;;
21
h | ?) echo "Options: -n skip download" ; exit 0 ;;
22
*) echo "Unknown option: $opt" ; exit 1 ;;
23
esac
24
done
25
if [ "$SKIP_DOWNLOAD" = "0" ]; then ./download-midpoint; fi
26
docker build --tag tier/midpoint:latest .
27
echo "---------------------------------------------------------------------------------------"
28
echo "The midPoint containers were successfully built. To start them, execute the following:"
29
echo ""
30
echo "(for simple demo)"
31
echo ""
32
echo "$ cd" $(normalize_path `pwd`/../demo/simple)