forked from talebook/talebook
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
43 lines (32 loc) · 1.08 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
.PHONY: all build push test
VER := $(shell git branch --show-current)
IMAGE := talebook/talebook:$(VER)
REPO1 := talebook/talebook:latest
REPO2 := talebook/calibre-webserver:latest
all: build up
build: test
docker build --no-cache=false --build-arg BUILD_COUNTRY=CN --build-arg GIT_VERSION=$(VER) \
-f Dockerfile -t $(IMAGE) -t $(REPO1) -t $(REPO2) .
push:
docker push $(IMAGE)
docker push $(REPO1)
docker push $(REPO2)
test: lint
rm -f unittest.log
docker build --build-arg BUILD_COUNTRY=CN -t talebook/test --target test -f Dockerfile .
docker run --rm --name=talebook-docker-test -v "$$PWD":"$$PWD" -w "$$PWD" talebook/test pytest --log-file=unittest.log --log-level=INFO tests
lint:
flake8 webserver --count --select=E9,F63,F7,F82 --show-source --statistics
flake8 webserver --count --statistics --config .style.yapf
pytest: lint
pytest tests
testv:
coverage run -m unittest
coverage report --include "*talebook*"
testvv: testv
coverage html -d ".htmlcov" --include "*talebook*"
cd ".htmlcov" && python3 -m http.server 7777
up:
docker-compose up -d
down:
docker-compose stop