You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
71 lines
2.0 KiB
71 lines
2.0 KiB
.PHONY: all help build virtualenv requirements-local loaddata run migrate shell collectstatic clean worker
|
|
|
|
# target: all - Default target. Does nothing.
|
|
all:
|
|
@clear
|
|
@echo "Hello $(LOGNAME), nothing to do by default"
|
|
@echo "Try 'make help'"
|
|
|
|
# target: help - Display callable targets.
|
|
help:
|
|
@clear
|
|
@egrep "^# target:" [Mm]akefile
|
|
|
|
# target: build - Build all docker containers, defined in docker-compose.yml
|
|
build:
|
|
docker-compose build
|
|
|
|
# target: virtualenv - Make virtualenv
|
|
virtualenv:
|
|
virtualenv -p python3 env --no-site-packages
|
|
|
|
# target: requirements-local - Install requirements for local develop
|
|
requirements-local:
|
|
$(PIP) install -r requirements/local.txt
|
|
|
|
# target: loaddata - Load fixtures
|
|
loaddata:
|
|
python src/manage.py loaddata src/myauth/fixtures/myauth.json
|
|
python src/manage.py loaddata src/commons/fixtures/cms.json
|
|
python src/manage.py loaddata src/commons/fixtures/djangocms_text_ckeditor.json
|
|
python src/manage.py loaddata src/commons/fixtures/sites.json
|
|
python src/manage.py loaddata src/customer/fixtures/price.json
|
|
python src/manage.py loaddata src/docs/fixtures/country.json
|
|
python src/manage.py loaddata src/docs/fixtures/currency.json
|
|
python src/manage.py loaddata src/docs/fixtures/measure.json
|
|
|
|
# target: run - Runserver
|
|
run:
|
|
python src/manage.py runserver 0.0.0.0:8000
|
|
|
|
# target: migrate - Build all docker containers, defined in docker-compose.stage.yml
|
|
migrate:
|
|
python src/manage.py migrate myauth --noinput
|
|
python src/manage.py migrate --noinput
|
|
|
|
# target: shell - Run python shell
|
|
shell:
|
|
python src/manage.py shell
|
|
|
|
# target: collectstatic - Run collectstatic
|
|
collectstatic:
|
|
python src/manage.py collectstatic --noinput
|
|
|
|
|
|
clean_temp:
|
|
find . -name '*.pyc' -delete
|
|
rm -rf .coverage dist docs/_build htmlcov MANIFEST
|
|
rm -rf media/
|
|
|
|
clean_db:
|
|
find . -name '*.sqlite3' -delete
|
|
|
|
clean_venv:
|
|
rm -rf $(VENV_DIR)
|
|
|
|
# target: clean - Clean all temp files
|
|
clean: clean_temp clean_venv clean_db
|
|
|
|
# target: worker - Run celery worker
|
|
worker:
|
|
cd src && celery -A dokumentor worker -l info -E
|
|
|