forked from FIWARE/tutorials.Time-Series-Data
-
Notifications
You must be signed in to change notification settings - Fork 1
/
services
executable file
·65 lines (58 loc) · 1.78 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#!/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 () {
./import-data
./provision-devices
echo ""
}
stoppingContainers () {
echo "Stopping containers"
docker-compose --log-level ERROR -p fiware down -v --remove-orphans
}
displayServices () {
echo ""
docker ps --format "table {{.Names}}\t{{.Status}}\t{{.Ports}}" --filter name=fiware-*
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")
stoppingContainers
echo -e "Starting seven containers \033[1;34mOrion\033[0m, \033[1;34mQuantumLeap\033[0m, \033[1;36mIoT-Agent\033[0m, \033[1;30mTutorial\033[0m, a \033[1;30mGrafana\033[0m metrics dashboard and \033[1;30mCrateDB\033[0m and \033[1;30mMongoDB\033[0m databases."
echo -e "- \033[1;34mOrion\033[0m is the context broker"
echo -e "- \033[1;34mQuantumLeap\033[0m will write to CrateDB"
echo -e "- \033[1;30mGrafana\033[0m will read from CrateDB"
echo -e "- \033[1;36mIoT-Agent\033[0m is configured for the UltraLight Protocol"
echo -e "- \033[1;30mTutorial\033[0m acts as a series of dummy IoT Sensors over HTTP"
echo ""
docker-compose --log-level ERROR -p fiware up -d --remove-orphans
loadData
displayServices
echo -e "Now open \033[4mhttp://localhost:3000/device/monitor\033[0m"
;;
"stop")
stoppingContainers
;;
"create")
echo "Pulling Docker images"
docker-compose --log-level ERROR -p fiware pull
;;
*)
echo "Command not Found."
echo "usage: services [create|start|stop]"
exit 127;
;;
esac