From afd6711f64c5d19f5a14cfe926285286b7a031ca Mon Sep 17 00:00:00 2001 From: Andros Fenollosa Date: Thu, 1 Apr 2021 09:58:13 +0200 Subject: [PATCH] Update README and Add Makefile --- Makefile | 33 +++++++++++++++++++++++++++++++++ README.md | 5 ++--- 2 files changed, 35 insertions(+), 3 deletions(-) create mode 100644 Makefile diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..6214c6e --- /dev/null +++ b/Makefile @@ -0,0 +1,33 @@ +.DEFAULT_GOAL := help +help: + @perl -nle'print $& if m{^[a-zA-Z_-]+:.*?## .*$$}' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-25s\033[0m %s\n", $$1, $$2}' + +clean: clean-build clean-pyc + +clean-build: ## remove build artifacts + rm -fr build/ + rm -fr dist/ + rm -fr *.egg-info + +clean-pyc: ## remove Python file artifacts + find . -name '*.pyc' -exec rm -f {} + + find . -name '*.pyo' -exec rm -f {} + + find . -name '*~' -exec rm -f {} + + +lint: ## check style with flake8 + flake8 . + black --check . + node_modules/.bin/prettier --check . + +test: ## run tests quickly with the default Python + pytest + +sdist: clean ## package + python setup.py sdist + ls -l dist + +run.migrations: + docker-compose -f docker-compose.dev.yaml run --rm -T --no-deps web sh -c "python manage.py migrate" + +run.server: + docker-compose -f docker-compose.dev.yaml up diff --git a/README.md b/README.md index 9090040..c3a9df2 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,6 @@ gulp dev ## Change path templates - In `settings.py`. ``` python @@ -50,7 +49,7 @@ Update `DIRS`. # Run development ``` sh -docker-compose -f docker-compose.dev.yaml up +make run.server ``` Now open: @@ -74,7 +73,7 @@ docker exec -it api_django_1 bash # Run production ``` sh -docker-compose up -d +docker-compose -f docker-compose.pro.yaml up ``` Open `https://domain.com`.