-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathMakefile
68 lines (48 loc) · 1.82 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
# import local .env with local env variables
$(shell touch .env)
include .env
export $(shell sed 's/=.*//' .env)
RUST_VERSION = 1.60
.PHONY: help build cloc doc-ci doc docker-login image image-push web lint test test-lint
help:
@echo ================================================================================
@fgrep -h "##" $(MAKEFILE_LIST) | fgrep -v fgrep | sed -e 's/\\$$//' | sed -e 's/##//'
@echo ================================================================================
build: ## build and test
cargo build
cargo test
cloc: ## Count lines of code - requires cloc
cloc --exclude-dir=target,.venv,node_modules,dist,.mypy_cache .
doc-ci: ## build documentation
@cargo doc --workspace --no-deps
doc: ## build documentation and open web page
@cargo doc --workspace --no-deps --open
docker-login: ## login to docker repos - this is for admins only
@./devops/docker-login
image: ## build docker image
docker build . -f devops/kollector.dockerfile -t kollector
image-web: ## build docker image
docker build . -f devops/web.dockerfile -t kollector-web
image-py: ## build pyservice image
docker build . -f devops/pyservice.dockerfile -t kollector-py
image-push: ## push image to repo
@echo skip
web: ## build web interface
protoc -I ./service/proto orderbook.proto --js_out=import_style=commonjs:web/proto
protoc -I ./service/proto orderbook.proto --grpc-web_out=import_style=commonjs,mode=grpcwebtext:web/proto
lint: ## lint code
@./devops/lint-py
@cargo fmt
@cargo clippy
lint-py:
@./devops/lint-py
service-py: ## start python service with console UI
@poetry run python main.py --console
test-py: ## test python service
@poetry run pytest -v
start: ## start dev services
@docker-compose -f devops/docker-compose.yml up
test: ## run tests
@echo skip
test-lint: ## lint
@cargo fmt --check