Update README and Add Makefile

This commit is contained in:
Andros Fenollosa 2021-04-01 09:58:13 +02:00
parent 17e952bdbd
commit afd6711f64
2 changed files with 35 additions and 3 deletions

33
Makefile Normal file
View File

@ -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

View File

@ -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`.