environment_sensors/Makefile

44 lines
889 B
Makefile
Raw Normal View History

2019-10-12 20:34:39 +02:00
SHELL=/bin/bash
.PHONY: run
run: venv/production
( \
source venv/bin/activate; \
./run.sh; \
)
2019-10-12 20:34:39 +02:00
2019-10-13 11:06:46 +02:00
test: venv/development
( \
source venv/bin/activate; \
2020-03-10 21:22:36 +01:00
export DJANGO_SETTINGS_MODULE=sensors.settings.production; \
pytest --nomigrations --cov=. --cov-report=html sensors/; \
)
2019-10-12 20:34:39 +02:00
2020-03-10 21:22:36 +01:00
migrations:
( \
export DJANGO_SETTINGS_MODULE=sensors.settings.development; \
./manage.py makemigrations collector; \
)
2019-10-13 11:06:46 +02:00
venv/development:
test -d venv || python3 -m venv venv --system-site-packages
2019-10-12 20:34:39 +02:00
( \
source venv/bin/activate; \
pip3 install -r requirements/development.txt; \
)
2019-10-13 11:06:46 +02:00
touch venv/development
2019-10-12 20:34:39 +02:00
venv/production:
test -d venv || python3 -m venv venv --system-site-packages
2019-10-12 20:34:39 +02:00
( \
source venv/bin/activate; \
pip3 install -Ur requirements/production.txt; \
touch venv/bin/activate: \
2019-10-13 11:06:46 +02:00
)
2019-10-12 20:34:39 +02:00
clean:
rm -rf venv/
find . \( -name __pycache__ -o -name "*.pyc" \) -delete
rm -rf htmlcov/