-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
57 lines (38 loc) · 1.35 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
VERSION := latest
IMG_NAME := username/appname
IMAGE := ${IMG_NAME}:${VERSION}
default: help
test: ## Run all tests
@cargo test
test-cov: ## Run all tests with coverage- `cargo install cargo-tarpaulin`
@cargo tarpaulin
build: ## Builds the app for current os-arch
@make test && cargo build --release
run: ## Runs the app
@CARGO_INCREMENTAL=1 cargo run --bin backend
lint: ## Run clippy
@find . -type f | grep '\/src\/.*\.rs'| xargs touch && cargo clippy --all-targets --workspace
lint-fix: ## Fix lint
@cargo fix
fmt: ## Run format
@cargo +nightly fmt
docker: ## Build a Docker Image
@DOCKER_BUILDKIT=1 docker build --rm -t ${IMAGE} .
docker-run: ## Run Docker Image locally
@docker run --rm ${IMAGE}
analyse: ## Analyse for unsafe usage - `cargo install cargo-geiger`
@cargo geiger
## Release tag
release: ## create new git tag and push it to remote
@git tag -a ${V} -m "Release ${V}" && git push origin ${V}
## Delete tag
delete-tag: ## delete git tag, both local and remote
@git tag -d ${V} && git push --delete origin ${V}
unused-deps: ## Find unused dependencies
@cargo +nightly udeps
.PHONY: help
.DEFAULT_GOAL := help
help:
@echo "[!] Available Command: "
@echo "-----------------------"
@grep -h -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' | sort