fix: skip assets volume in cleandb script + add confirm prompt to cleanall (#4038)

* fix: skip assets volume in cleandb script + add confirm prompt to cleanall

* fix: remove purge dangling images from cleanall script
This commit is contained in:
Nicolas Giard 2022-06-13 13:13:16 -04:00 committed by GitHub
parent d0e6fd62cb
commit 083732557d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 9 deletions

View file

@ -1,9 +1,12 @@
#!/bin/bash
cd ..
echo "Shutting down any instance still running and purge images..."
docker compose down -v --rmi all
echo "Purging dangling images..."
docker image prune
cd docker
echo "Done!"
read -p "Stop and remove all containers, volumes and images for this project? [y/N] " -n 1 -r
echo
if [[ $REPLY =~ ^[Yy]$ ]]
then
cd ..
echo "Shutting down any instance still running and purge images..."
docker compose down -v --rmi all
cd docker
echo "Done!"
fi

View file

@ -1,8 +1,11 @@
#!/bin/bash
echo "Shutting down any instance still running..."
cd ..
docker compose down -v
echo "Shutting down any instance still running..."
docker compose down
echo "Removing DB volume..."
PROJNAME=$(basename $PWD)
docker volume rm -f "${PROJNAME}_mariadb-data"
echo "Rebuilding the DB image..."
docker compose pull db
docker compose build --no-cache db