Permalink
Branch: master
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
executable file 98 lines (91 sloc) 2.72 KB
#!/bin/bash
#
# Command Line Interface to start all services associated with the Fast/Micro-RTPS tutorials
#
# For this tutorial the commands are merely a convenience script to run docker-compose
#
set -e
stoppingContainers () {
echo "Stopping containers"
docker-compose --log-level ERROR -f docker-compose/kurento-with-filters.yml -p fiware down -v --remove-orphans
}
startingContainers () {
echo -e "Starting two containers - \033[1;35mKurento\033[0m and \033[1;30mKurento-Examples (${command})\033[0m"
echo -e "- \033[1;35mKurento\033[0m is a Media Server"
echo -e "- \033[1;30mKurento-Examples\033[0m displays a web app to access the web-cam"
echo ""
TUTORIAL_NAME=${command} docker-compose --log-level ERROR -f docker-compose/kurento-with-filters.yml -p fiware up -d --remove-orphans
echo ""
echo -e "Now open \033[4mhttps://localhost:8443\033[0m"
}
if (( $# != 1 )); then
echo "Illegal number of parameters"
echo "usage: services [start|stop|create]"
exit 1
fi
command="$1"
case "${command}" in
"help")
echo "usage: services [start|stop]"
;;
"start")
stoppingContainers;
echo -e "Starting two containers - \033[1;35mKurento\033[0m and \033[1;30mKurento-Examples (hello-world)\033[0m"
echo -e "- \033[1;35mKurento\033[0m is a Media Server"
echo -e "- \033[1;30mKurento-Examples\033[0m displays a web app to access the web-cam"
echo ""
docker-compose --log-level ERROR -f docker-compose/kurento.yml -p fiware up -d --remove-orphans
echo ""
echo -e "Now open \033[4mhttps://localhost:8443\033[0m"
;;
"chroma")
stoppingContainers;
startingContainers;
;;
"crowddetector")
stoppingContainers;
startingContainers;
;;
"hello-world")
stoppingContainers;
echo -e "Starting two containers - \033[1;35mKurento\033[0m and \033[1;30mKurento-Examples (hello-world)\033[0m"
docker-compose --log-level ERROR -f docker-compose/kurento.yml -p fiware up -d --remove-orphans
echo ""
echo -e "Now open \033[4mhttps://localhost:8443\033[0m"
;;
"magic-mirror")
stoppingContainers;
startingContainers;
;;
"module-tests-api")
stoppingContainers;
startingContainers;
;;
"one2many-call")
stoppingContainers;
startingContainers;
;;
"one2one-call")
stoppingContainers;
startingContainers;
;;
"platedetector")
stoppingContainers;
startingContainers;
;;
"pointerdetector")
stoppingContainers;
startingContainers;
;;
"stop")
stoppingContainers
;;
"create")
echo "Obtaining Latest Kurento Image"
docker pull fiware/stream-oriented-kurento
echo "Recreate Kurento with Filters"
docker build -t fiware/stream-oriented-kurento-plus-filters ./docker-compose
echo "Recreate Kurento examples"
docker build -t fiware/kurento-examples ./kurento-examples
;;
esac