forked from talebook/talebook
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
39 lines (29 loc) · 1020 Bytes
/
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
.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 update
build:
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)
docker-test:
docker build --build-arg BUILD_COUNTRY=CN -t talebook/test --target test -f Dockerfile .
docker run --rm --name talebook-docker-test talebook/test
lint:
flake8 webserver --count --select=E9,F63,F7,F82 --show-source --statistics
flake8 webserver --count --exit-zero --statistics --config .style.yapf
test: 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
update:
docker-compose -f docker/docker-compose.yml up -d