forked from eclipse-iofog/demo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
stop.sh
executable file
·54 lines (43 loc) · 1.25 KB
/
stop.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
#!/usr/bin/env bash
#
# stop.sh - will tear down a running docker-compose Demo environment
#
# Usage : ./stop.sh -h
#
set -o errexit -o pipefail -o noclobber -o nounset
cd "$(dirname "$0")"
# Import our helper functions
. ./utils.sh
printHelp() {
echo "Usage: ./stop.sh"
echo "Stops ioFog environments and optionally sets up demo and tutorial environment"
echo ""
echo "Arguments:"
echo " -h, --help print this help / usage"
}
while [[ "$#" -ge 1 ]]; do
case "$1" in
-h|--help)
printHelp
exit 0
;;
*)
echoError "Unrecognized argument: \"$1\""
printHelp
exit 1
;;
esac
done
prettyHeader "Stopping ioFog Demo..."
# Stop ioFog stack
echoInfo "Stopping all containers..."
docker-compose -f "docker-compose-iofog.yml" -f "docker-compose-tutorial.yml" down -v
# TODO stopping the ioFog stack leaves its microservices running - fix this properly
REMAINING_MSVC=`docker ps -q --filter 'name=iofog*'`
if [ ! -z "${REMAINING_MSVC}" ]; then
docker rm -f ${REMAINING_MSVC}
fi
# Remove generated files
find test/conf -type f -not -name ".gitignore" -exec rm -f {} \;
rm -f "services/iofog/iofog-agent/id_ecdsa.pub"
prettyTitle "ioFog demo is stopped"