Skip to content
Permalink
Newer
Older
100755 48 lines (46 sloc) 1.44 KB
Sep 27, 2018
1
#!/bin/bash
2
3
cd "$(dirname "$0")"
4
source common.bash
5
Sep 28, 2018
6
SKIP_DOWNLOAD=0
8
while getopts "nhr?" opt; do
Sep 28, 2018
9
case $opt in
10
n)
11
SKIP_DOWNLOAD=1
12
;;
13
r)
14
result=$(docker ps -a | grep $maintainer/$imagename:$tag)
15
if [ ! -z "$result" ]; then
16
echo "Cleaning up $maintainer/$imagename:$tag..."
17
docker rm -f $(docker ps -a | grep $maintainer/$imagename:$tag | awk '{print $1}')
18
docker rmi -f $maintainer/$imagename:$tag
19
echo "Done"
20
fi
21
REFRESH="--no-cache --pull"
22
echo "Using 'refresh' mode: $REFRESH"
23
;;
24
h | ?)
25
echo "Options: -n skip download"
26
echo " -r refresh mode: uses --no-cache --pull and removes container and image before build"
27
exit 0
28
;;
29
*)
30
echo "Unknown option: $opt"
31
exit 1
32
;;
Sep 28, 2018
33
esac
34
done
35
if [ "$SKIP_DOWNLOAD" = "0" ]; then ./download-midpoint.sh || exit 1; fi
36
docker build $REFRESH --tag $maintainer/$imagename:$tag --build-arg maintainer=$maintainer --build-arg imagename=$imagename . || exit 1
Sep 27, 2018
37
echo "---------------------------------------------------------------------------------------"
38
echo "The midPoint containers were successfully built. To start them, execute the following:"
39
echo ""
40
echo "(for simple demo)"
41
echo ""
Oct 1, 2018
42
echo "$ cd" $(pwd)/demo/simple
43
echo "$ docker-compose up"
Sep 27, 2018
44
echo ""
45
echo "(for Grouper integration demo)"
Sep 27, 2018
46
echo ""
47
echo "$ cd" $(pwd)/demo/grouper
Sep 27, 2018
48
echo "$ docker-compose up --build"
You can’t perform that action at this time.