Skip to content

Commit 4397073

Browse files
committed
Cleanup docker after testing, remove the folder before testing. This way we can inspect the results if needed.
1 parent 9230ad4 commit 4397073

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

tests/test_docker.sh

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,26 @@
55

66
set -o errexit
77
set -x
8+
set -e
9+
10+
finish() {
11+
# Your cleanup code here
12+
docker compose -f docker-compose.local.yml down --remove-orphans
13+
docker volume rm my_awesome_project_my_awesome_project_local_postgres_data
14+
15+
}
16+
# the cleanup doesn't work in the github actions
17+
if [ -z "$GITHUB_ACTIONS" ]; then
18+
trap finish EXIT
19+
fi
20+
821

922
# create a cache directory
1023
mkdir -p .cache/docker
1124
cd .cache/docker
1225

26+
sudo rm -rf my_awesome_project
27+
1328
# create the project using the default settings in cookiecutter.json
1429
uv run cookiecutter ../../ --no-input --overwrite-if-exists use_docker=y "$@"
1530
cd my_awesome_project

0 commit comments

Comments
 (0)