-
Notifications
You must be signed in to change notification settings - Fork 20
/
Copy pathMakefile
81 lines (57 loc) · 1.96 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
79
80
81
.PHONY: help
.DEFAULT_GOAL := help
define PRINT_HELP_PYSCRIPT
import re, sys
for line in sys.stdin:
match = re.match(r'^([a-zA-Z_-]+):.*?## (.*)$$', line)
if match:
target, help = match.groups()
print("%-30s %s" % (target, help))
endef
export PRINT_HELP_PYSCRIPT
help:
@python -c "$$PRINT_HELP_PYSCRIPT" < $(MAKEFILE_LIST)
flake8: ## lint
poetry run flake8 tifa
publish: ## publish package to pypi
poetry publish --build
test: ## test
docker-compose run --rm tifa-toolbox-test bash -c "python -m pytest tests"
format: ## publish package to pypi
black tifa
black tests
shell_plus:
docker-compose run --rm tifa-toolbox bash -c "tifa-cli shell_plus"
dbinit:
docker-compose run --rm tifa-toolbox bash -c "tifa-cli db init"
dbmakemigrations:
docker-compose run --rm tifa-toolbox bash -c "tifa-cli db makemigrations"
dbmigrate:
docker-compose run --rm tifa-toolbox bash -c "tifa-cli db migrate"
docker-build: ## build and compose up
docker-compose build && docker-compose up
docker-build-no-cache: ## build --no-cache
docker-compose build --no-cache && docker-compose up
before-up: ## some deamons
docker-compose up -d redis postgres zookeeper kafka
before-full-up: ## some deamons
docker-compose up -d redis postgres elasticsearch jaeger grafana prometheus
start: ## runserver
make before-up
docker-compose stop tifa-web
docker-compose up --no-deps tifa-web
beat: ## beat
docker-compose up tifa-beat
worker: ## worker
docker-compose up tifa-worker
tifa-monitor: ## flower
docker-compose up tifa-monitor
# docker images
build-tifa: ## > tifa
docker build -t 'tifa:local' -f 'compose/app/Dockerfile' .
build-tifa-no-cache: ## > tifa
docker build -t 'tifa:local' -f 'compose/app/Dockerfile' --no-cache .
build-elasticsearch: ## > elasticsearch
docker build -t 'elasticsearch:local' -f 'compose/elasticsearch/Dockerfile' .
build-elasticsearch-no-cache: ## > elasticsearch
docker build -t 'elasticsearch:local' -f 'compose/elasticsearch/Dockerfile' . --no-cache