-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
52 lines (37 loc) · 1.1 KB
/
Makefile
File metadata and controls
52 lines (37 loc) · 1.1 KB
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
.PHONY: help build test run docker-build docker-up docker-down clean migrate-up migrate-down
help: ## Show this help message
@echo 'Usage: make [target]'
@echo ''
@echo 'Available targets:'
@awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z_-]+:.*?## / {printf " %-20s %s\n", $$1, $$2}' $(MAKEFILE_LIST)
build: ## Build the project
cargo build --release
test: ## Run tests
cargo test
run: ## Run the application
cargo run
dev: ## Run in development mode with auto-reload
cargo watch -x run
docker-build: ## Build Docker image
docker build -t rust-rest-api .
docker-up: ## Start Docker Compose services
docker-compose up -d
docker-down: ## Stop Docker Compose services
docker-compose down
docker-logs: ## View Docker logs
docker-compose logs -f
migrate-up: ## Run database migrations
sqlx migrate run
migrate-down: ## Revert last migration
sqlx migrate revert
clean: ## Clean build artifacts
cargo clean
docker-compose down -v
fmt: ## Format code
cargo fmt
lint: ## Run clippy
cargo clippy -- -D warnings
check: ## Run all checks (fmt, clippy, test)
cargo fmt --check
cargo clippy -- -D warnings
cargo test