Package/lib/binary renamed (gate_watch crate), SPA branding + storage keys, docker-compose services/db renamed, Dockerfile drops the lpr-whitelist git credential. CI keeps build+push (image name follows the repo) and the Telegram notify, but the prefecture deploy webhook is gone. Prefecture-specific deploy/ configs and historical docs/ removed (git history keeps them).
78 lines
1.7 KiB
Makefile
78 lines
1.7 KiB
Makefile
# Gate Watch - Makefile
|
|
|
|
# Docker socket for Colima
|
|
DOCKER_HOST := unix://$(HOME)/.colima/default/docker.sock
|
|
|
|
.PHONY: test test-unit test-all test-coverage coverage build run clean help
|
|
|
|
## Testing
|
|
|
|
test: ## Run unit tests only (no Docker required)
|
|
cargo test
|
|
|
|
test-unit: test ## Alias for test
|
|
|
|
test-all: ## Run all tests including integration (requires Docker)
|
|
DOCKER_HOST=$(DOCKER_HOST) cargo test -- --include-ignored
|
|
|
|
test-coverage: ## Run tests with coverage report (no Docker)
|
|
cargo llvm-cov --summary-only
|
|
|
|
coverage: ## Run all tests with coverage report (requires Docker)
|
|
DOCKER_HOST=$(DOCKER_HOST) cargo llvm-cov --summary-only -- --include-ignored
|
|
|
|
coverage-html: ## Generate HTML coverage report (requires Docker)
|
|
DOCKER_HOST=$(DOCKER_HOST) cargo llvm-cov --html -- --include-ignored
|
|
@echo "Report generated at target/llvm-cov/html/index.html"
|
|
|
|
## Development
|
|
|
|
build: ## Build the project
|
|
cargo build
|
|
|
|
build-release: ## Build release version
|
|
cargo build --release
|
|
|
|
run: ## Run the application
|
|
cargo run
|
|
|
|
check: ## Run cargo check
|
|
cargo check
|
|
|
|
fmt: ## Format code
|
|
cargo fmt
|
|
|
|
lint: ## Run clippy
|
|
cargo clippy -- -D warnings
|
|
|
|
## Database
|
|
|
|
migrate: ## Run database migrations
|
|
cargo sqlx migrate run
|
|
|
|
sqlx-prepare: ## Prepare SQLx offline queries
|
|
cargo sqlx prepare
|
|
|
|
## Docker
|
|
|
|
docker-build: ## Build Docker image
|
|
docker build -t gate-watch .
|
|
|
|
docker-run: ## Run Docker container
|
|
docker-compose up -d
|
|
|
|
docker-stop: ## Stop Docker container
|
|
docker-compose down
|
|
|
|
## Cleanup
|
|
|
|
clean: ## Clean build artifacts
|
|
cargo clean
|
|
|
|
## Help
|
|
|
|
help: ## Show this help
|
|
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}'
|
|
|
|
.DEFAULT_GOAL := help
|