Permalink
Branch: master
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
executable file 48 lines (44 sloc) 1.05 KB
#!/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
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