-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile
78 lines (64 loc) · 1.73 KB
/
Makefile
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
SHELL=/bin/bash
HAS_PIPENV = $(shell which pipenv && echo 'true' || echo 'false')
ifneq ("$(HAS_PIPENV)", "false")
PYTHON = pipenv run python
else
PYTHON = python
endif
.DEFAULT_GOAL := all
## help: Display list of commands (from gazr.io)
.PHONY: help
help: Makefile
@sed -n 's|^##||p' $< | column -t -s ':' | sed -e 's|^| |'
## all: Run all targets
.PHONY: all
all: init style test build
## init: Install required depedencies
.PHONY: init
init:
pipenv install --deploy
## init-dev: Install development depedencies
.PHONY: init-dev
init-dev:
pipenv install --deploy --dev
pipenv run pre-commit install -t pre-commit
pipenv run pre-commit install -t prepare-commit-msg
pipenv run pre-commit install -t commit-msg
## clean: Remove app environment and temporary files
.PHONY: clean
clean:
pipenv --rm || true
rm -f *.log || true
rm -rf ".venv" || true
rm -rf coverage.xml junit-coverage.xml || true
pipenv run pre-commit uninstall -t pre-commit
pipenv run pre-commit uninstall -t prepare-commit-msg
pipenv run pre-commit uninstall -t commit-msg
## style: Check lint, code styling rules, format code
.PHONY: style
style:
pipenv run pre-commit run --all-files
## test: Launch all tests
.PHONY: test
test:
$(PYTHON) manage.py test
## run: Locally run the development server
.PHONY: run
run:
$(PYTHON) manage.py runserver
## build: Build the Docker application
.PHONY: build
build:
docker build --pull --rm \
--target app \
--tag woolly-api:dev \
--file Dockerfile \
.
## db-migrate: Apply all migrations to database
.PHONY: db-migrate
db-migrate:
$(PYTHON) manage.py migrate
# Initiate default values
$(PYTHON) manage.py init_defaults all
# Get all associations with fun_id in database
$(PYTHON) manage.py fetch_fun_ids --report