Merge pull request #154 from mainflux/docker-clean

Add `clean` function to docker-compose script
This commit is contained in:
Nikola Marčetić 2018-02-05 10:47:31 +01:00 committed by GitHub
commit 6099da59e6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 17 additions and 1 deletions

View File

@ -150,7 +150,7 @@ _stop() {
printf "\nStopping Nginx...\n\n"
docker-compose -f docker/docker-compose.nginx.yml stop
printf "Stopping Mainflux composition...\n\n"
printf "\nStopping Mainflux composition...\n\n"
docker-compose -f docker/docker-compose.mainflux.yml stop
printf "\nStopping NATS and Cassandra...\n\n"
@ -159,6 +159,19 @@ _stop() {
printf "\n*** MAINFLUX IS OFF ***\n\n"
}
_clean() {
printf "\nCleaning NATS and Cassandra containers...\n\n"
docker-compose -f docker/docker-compose.infrastructure.yml rm -f
printf "\nCleaning Mainflux containers...\n\n"
docker-compose -f docker/docker-compose.mainflux.yml rm -f
printf "\nCleaning Nginx container...\n\n"
docker-compose -f docker/docker-compose.nginx.yml rm -f
printf "\n*** Docker containers cleaned ***\n\n"
}
_mainflux_docker() {
if [[ $1 == "start" ]]
then
@ -166,6 +179,9 @@ _mainflux_docker() {
elif [[ $1 == "stop" ]]
then
_stop
elif [[ $1 == "clean" ]]
then
_clean
else
printf "Unknown command.\n"
fi