Permalink
Cannot retrieve contributors at this time
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
executable file
29 lines (23 sloc)
753 Bytes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# | |
# Delete all containers and volumes. If called as `bin/down everything`, also | |
# delete the shared containers and volumes. | |
# | |
source "${BASH_SOURCE%/*}/.helpers.sh" | |
for ENV in development test | |
do | |
docker_compose_in_env $ENV down --volumes | |
done | |
if [ "$1" == "everything" ]; then | |
read -p "THIS WILL DESTROY YOUR DATA. Ctrl-C to abort or enter to continue." | |
docker_compose_in_env shared down --volumes | |
else | |
docker_compose_in_env shared stop | |
# Remove any node_modules volumes that might be stale, but keep other data. | |
ADD_PROJECT_NAME="s/^/todo_/" | |
docker_compose_in_env shared config --volumes | \ | |
grep node_modules | sed "$ADD_PROJECT_NAME" | while read VOLUME | |
do | |
docker volume rm --force $VOLUME | |
done | |
fi |