Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
executable file 60 lines (54 sloc) 1.26 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 ""
}
displayServices () {
echo ""
docker ps --format "table {{.Names}}\t{{.Status}}\t{{.Ports}}" --filter name=fiware-*
echo ""
}
stoppingContainers () {
echo "Stopping containers"
docker-compose --log-level ERROR -p fiware down -v --remove-orphans
}
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 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
displayServices
;;
"stop")
stoppingContainers
;;
"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
You can’t perform that action at this time.