forked from FIWARE/tutorials.CRUD-Operations
-
Notifications
You must be signed in to change notification settings - Fork 0
/
services
executable file
·53 lines (46 loc) · 1.11 KB
/
services
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
#!/bin/bash
#
# Command Line Interface to start all services associated with the Getting-Started Tutorial
#
# For this tutorial the commands are merely a convenience script to run docker-compose
#
set -e
loadData () {
printf "Loading context data "
./import-data
echo -e " \033[1;32mdone\033[0m"
echo ""
}
if (( $# != 1 )); then
echo "Illegal number of parameters"
echo "usage: services [create|start|stop]"
exit 1
fi
command="$1"
case "${command}" in
"help")
echo "usage: services [create|start|stop]"
;;
"start")
echo -e "Starting two containers \033[1;34mOrion\033[0m and a \033[1;30mMongoDB\033[0m database."
echo -e "- \033[1;34mOrion\033[0m is the context broker"
echo ""
docker-compose --log-level ERROR -p fiware up -d --remove-orphans
loadData
;;
"stop")
echo "stopping containers"
docker-compose --log-level ERROR -p fiware down -v --remove-orphans
;;
"create")
echo "Obtaining Mongo DB image"
docker pull mongo:3.6
echo "Obtaining Latest Orion Image"
docker pull fiware/orion
;;
*)
echo "Command not Found."
echo "usage: services [create|start|stop]"
exit 127;
;;
esac