-
-
Notifications
You must be signed in to change notification settings - Fork 80
/
Makefile
53 lines (40 loc) · 1.11 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
VERSION := latest
IMG_NAME := deepu105/kdash
IMAGE := ${IMG_NAME}:${VERSION}
default: run
## Run all tests
test:
@make lint && cargo test
## Run all tests with coverage- `cargo install cargo-tarpaulin`
test-cov:
@cargo tarpaulin
## Builds the app for current os-arch
build:
@make test && cargo build --release
## Runs the app
run:
@cargo fmt && make lint && CARGO_INCREMENTAL=1 cargo run -- $(filter-out $@, $(MAKECMDGOALS))
## Run clippy
lint:
@CARGO_INCREMENTAL=0 cargo clippy --all --all-features --all-targets --workspace -- -D warnings
## Fix lint
lint-fix:
@cargo fix --allow-staged
## Run format
fmt:
@cargo fmt
## Build a Docker Image
docker:
@DOCKER_BUILDKIT=1 docker build --progress=plain --rm -t ${IMAGE} .
## Run Docker Image locally
docker-run:
@docker run --network host --rm -it -v ~/.kube/config:/root/.kube/config ${IMAGE}
## Analyse for unsafe usage - `cargo install cargo-geiger`
analyse:
@cargo geiger
## Release tag
release:
@git tag -a ${V} -m "Release ${V}" && git push origin ${V}
## Delete tag
delete-tag:
@git tag -d ${V} && git push --delete origin ${V}