-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
51 lines (36 loc) · 1.53 KB
/
Copy pathMakefile
File metadata and controls
51 lines (36 loc) · 1.53 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# This Makefile is based on the Makefile defined in the Python Best Practices repository:
# https://git.datapunt.amsterdam.nl/Datapunt/python-best-practices/blob/master/dependency_management/
#
# VERSION = 2021.09.14
.PHONY: help test init
dc = docker-compose -f docker.yml
run = $(dc) run --rm django
manage = $(run) python manage.py
pytest = $(run) pytest $(ARGS)
init: clean build migrate ## Init clean
help: ## Show this help.
@fgrep -h "##" $(MAKEFILE_LIST) | fgrep -v fgrep | sed -e 's/\\$$//' | sed -e 's/##//'
install:
pip install -r requirements.txt
migrations: ## Make migrations
$(manage) makemigrations $(ARGS)
migrate: ## Migrate
$(manage) migrate
urls: ## Show URL endpoints
$(manage) show_urls
superuser: ## Create a superuser (user with admin rights)
$(manage) createsuperuser
env: ## Print current env
env | sort
run: ## Run in local Docker container
$(dc) up
clean: ## Clean docker stuff
$(dc) down -v --remove-orphans
build: ## Build docker image
$(dc) build
test: ## Run all automated tests
$(pytest) --timeout=5 --cov=fires_watch/fires --cov-report term --cov-fail-under=95
status: ## Show container status
$(dc) ps
run-command: ## Run a manage.py command
$(manage) $(ARGS)