Skip to content

Commit 0837325

Browse files
authored
fix: skip assets volume in cleandb script + add confirm prompt to cleanall (ietf-tools#4038)
* fix: skip assets volume in cleandb script + add confirm prompt to cleanall * fix: remove purge dangling images from cleanall script
1 parent d0e6fd6 commit 0837325

2 files changed

Lines changed: 15 additions & 9 deletions

File tree

docker/cleanall

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
#!/bin/bash
22

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

docker/cleandb

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
#!/bin/bash
22

3-
echo "Shutting down any instance still running..."
43
cd ..
5-
docker compose down -v
4+
echo "Shutting down any instance still running..."
5+
docker compose down
6+
echo "Removing DB volume..."
7+
PROJNAME=$(basename $PWD)
8+
docker volume rm -f "${PROJNAME}_mariadb-data"
69
echo "Rebuilding the DB image..."
710
docker compose pull db
811
docker compose build --no-cache db

0 commit comments

Comments
 (0)