-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
64 lines (46 loc) · 1.39 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
.PHONY: help all base dev upgrade check clean run test unittest build
help:
@echo 'Usage:'
@sed -n 's/^##//p' ${MAKEFILE_LIST} | column -t -s ':' | sed -e 's/^/ /'
objects = $(wildcard *.in)
outputs := $(objects:.in=.txt)
## all: build all .txt files
all: $(outputs)
%.txt: %.in
pip-compile --verbose --generate-hashes --output-file $@ $<
dev-requirements.txt: requirements.txt
## base: build requirements.txt
base: requirements.txt
## dev: build dev-requirements.txt
dev: dev-requirements.txt
## pip.install: install all dependencies
pip.install: $(outputs)
pip-sync --ask $(outputs)
## pip.install-base: install base dependencies only
pip.install-base: requirements.txt
pip-sync --ask requirements.txt
## pip.upgrade: upgrade base dependencies only
pip.upgrade: requirements.txt
pip-compile --upgrade --generate-hashes $<
## check: check pip-tools installed
check:
@if ! command -v pip-compile > /dev/null; then echo "pip-tools not installed!"; fi
## clean: clean all *.txt files
clean: check
- rm *.txt
## run.dev: run Flask debug server
run.dev:
python3 app.py --dev
## run: run Gunicorn server
run:
python3 app.py
## test: run all tests
test:
pytest
## test: run unit tests only
unittest:
pytest --ignore=tests/integration
%.build: docker/Dockerfile
docker build . -f $< -t ghcr.io/kencx/calibre_rest:$(version)-$* --target=$*
## build: build all Docker images
build: app.build calibre.build