mirror of
https://github.com/cookiecutter/cookiecutter-django.git
synced 2025-09-09 21:42:34 +03:00
Cleanup docker after testing, remove the folder before testing. This way we can inspect the results if needed.
This commit is contained in:
parent
9230ad4487
commit
4397073541
|
@ -5,11 +5,26 @@
|
|||
|
||||
set -o errexit
|
||||
set -x
|
||||
set -e
|
||||
|
||||
finish() {
|
||||
# Your cleanup code here
|
||||
docker compose -f docker-compose.local.yml down --remove-orphans
|
||||
docker volume rm my_awesome_project_my_awesome_project_local_postgres_data
|
||||
|
||||
}
|
||||
# the cleanup doesn't work in the github actions
|
||||
if [ -z "$GITHUB_ACTIONS" ]; then
|
||||
trap finish EXIT
|
||||
fi
|
||||
|
||||
|
||||
# create a cache directory
|
||||
mkdir -p .cache/docker
|
||||
cd .cache/docker
|
||||
|
||||
sudo rm -rf my_awesome_project
|
||||
|
||||
# create the project using the default settings in cookiecutter.json
|
||||
uv run cookiecutter ../../ --no-input --overwrite-if-exists use_docker=y "$@"
|
||||
cd my_awesome_project
|
||||
|
|
Loading…
Reference in New Issue
Block a user