-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
82 lines (59 loc) · 1.41 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
default: help
.PHONY: help
help:
@echo 'Usage: make [target]'
@echo ''
@echo 'Run "make fmt" and "make lint" before committing code.'
@echo ''
@echo 'Commands:'
@echo 'build Builds the code.'
@echo 'test Test the code.'
@echo 'run Runs the code.'
@echo ''
@echo 'build-docker Build the docker image.'
@echo 'dev Runs the code in development mode with hot reloading.'
@echo 'down Down the docker containers.'
@echo 'logs Get the logs.'
@echo ''
@echo 'fmt Format code.'
@echo 'fmt/check Check for formatting errors.'
@echo 'install Install the necessary rust components.'
@echo 'lint Fix linting issues.'
@echo 'lint/check Check for bad coding practices.'
.PHONY: build
build:
cargo build
.PHONY: run
run:
cargo run
.PHONY: test
test:
cargo test
.PHONY: build-docker
build-docker:
docker compose -f infra/docker-compose.yml build
.PHONY: dev
dev:
docker compose -f infra/docker-compose.yml -f infra/docker-compose.dev.yml up --watch --build
.PHONY: down
down:
docker compose -f infra/docker-compose.yml down
.PHONY: logs
logs:
docker compose -f infra/docker-compose.yml logs --follow
.PHONY: install
install:
rustup component add clippy
rustup component add rustfmt
.PHONY: fmt
fmt:
cargo fmt
.PHONY: fmt/check
fmt/check:
cargo fmt --check
.PHONY: lint
lint:
cargo clippy --fix
.PHONY: lint/check
lint/check:
cargo clippy