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

View file

@ -1,8 +1,11 @@
#!/bin/bash #!/bin/bash
echo "Shutting down any instance still running..."
cd .. 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..." echo "Rebuilding the DB image..."
docker compose pull db docker compose pull db
docker compose build --no-cache db docker compose build --no-cache db