Skip to content

Commit

Permalink
Merge pull request #154 from mainflux/docker-clean
Browse files Browse the repository at this point in the history
Add `clean` function to docker-compose script
  • Loading branch information
nmarcetic authored Feb 5, 2018
2 parents 411cbf5 + 0255a4c commit 6099da5
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion bin/mainflux-docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -159,13 +159,29 @@ _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
_start
elif [[ $1 == "stop" ]]
then
_stop
elif [[ $1 == "clean" ]]
then
_clean
else
printf "Unknown command.\n"
fi
Expand Down

0 comments on commit 6099da5

Please sign in to comment.