Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
executable file 63 lines (54 sloc) 1.36 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 () {
export TUTORIAL_DATA_MODELS_CONTEXT="https://fiware.github.io/tutorials.Step-by-Step/tutorials-context.jsonld"
echo ""
./import-data
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 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 "Pulling Docker images"
docker-compose --log-level ERROR -p fiware pull
;;
*)
echo "Command not Found."
echo "usage: services [create|start|stop]"
exit 127;
;;
esac
You can’t perform that action at this time.