Skip to content

Commit

Permalink
fix: Ensure called from the docker directory (#7689)
Browse files Browse the repository at this point in the history
  • Loading branch information
richsalz authored Jul 15, 2024
1 parent 392511f commit 475cf2f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
7 changes: 6 additions & 1 deletion docker/cleanall
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
#!/bin/bash

if test $(basename $PWD ) != "docker"
then
echo "Run this from the docker directory" 1>&2
exit 1
fi

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
8 changes: 7 additions & 1 deletion docker/cleandb
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
#!/bin/bash

if test $(basename $PWD ) != "docker"
then
echo "Run this from the docker directory" 1>&2
exit 1
fi

cd ..
echo "Shutting down any instance still running..."
docker compose down
Expand All @@ -9,5 +15,5 @@ docker volume rm -f "${PROJNAME}_postgresdb-data"
echo "Rebuilding the DB image..."
docker compose pull db
docker compose build --no-cache db
cd docker

echo "Done!"

0 comments on commit 475cf2f

Please sign in to comment.