.PHONY: help build test clean docker run dev fmt lint bench docs
help:
@echo "Syros - Makefile Commands"
@echo "=================================="
@echo "Development:"
@echo " dev - Start development environment"
@echo " build - Build the project"
@echo " test - Run all tests"
@echo " bench - Run benchmarks"
@echo " fmt - Format code"
@echo " lint - Run linter"
@echo " clean - Clean build artifacts"
@echo ""
@echo "Docker:"
@echo " docker - Build Docker image"
@echo " run - Run with Docker Compose"
@echo " stop - Stop Docker Compose"
@echo ""
@echo "Documentation:"
@echo " docs - Generate documentation"
@echo " serve-docs - Serve documentation locally"
@echo ""
@echo "Release:"
@echo " release - Build release version"
@echo " package - Create release package"
dev:
@echo "๐ Starting development environment..."
docker-compose up -d redis etcd postgres
@echo "โ
Infrastructure started"
@echo "๐ง Run 'cargo run' to start Syros"
build:
@echo "๐จ Building Syros..."
cargo build
test:
@echo "๐งช Running tests..."
cargo test --verbose
@echo "๐งช Running integration tests..."
cargo test --test integration --verbose
bench:
@echo "๐ Running benchmarks..."
cargo bench
fmt:
@echo "๐จ Formatting code..."
cargo fmt --all
lint:
@echo "๐ Running linter..."
cargo clippy --all-targets --all-features -- -D warnings
clean:
@echo "๐งน Cleaning build artifacts..."
cargo clean
docker system prune -f
docker:
@echo "๐ณ Building Docker image..."
docker build -t syros .
run:
@echo "๐ Starting Syros with Docker Compose..."
docker-compose up -d
@echo "โ
Syros started!"
@echo ""
@echo "๐ Services available at:"
@echo " - REST API: http://localhost:8080"
@echo " - gRPC: localhost:9090"
@echo " - WebSocket: ws://localhost:8081/ws"
@echo " - Prometheus: http://localhost:9091"
@echo " - Grafana: http://localhost:3000 (admin/admin)"
stop:
@echo "๐ Stopping Syros..."
docker-compose down
docs:
@echo "๐ Generating documentation..."
cargo doc --no-deps --open
serve-docs:
@echo "๐ Serving documentation at http://localhost:8000..."
python3 -m http.server 8000 -d target/doc
release:
@echo "๐ Building release version..."
cargo build --release
@echo "โ
Release build completed: target/release/syros"
package: release
@echo "๐ฆ Creating release package..."
mkdir -p dist
cp target/release/syros dist/
cp -r config dist/
cp -r examples dist/
cp README.md LICENSE dist/
tar -czf dist/syros-$(shell cargo pkgid | cut -d# -f2).tar.gz -C dist .
@echo "โ
Release package created: dist/syros-*.tar.gz"
setup:
@echo "โ๏ธ Setting up development environment..."
@command -v docker >/dev/null 2>&1 || { echo "โ Docker is required but not installed."; exit 1; }
@command -v docker-compose >/dev/null 2>&1 || { echo "โ Docker Compose is required but not installed."; exit 1; }
@command -v rust >/dev/null 2>&1 || { echo "โ Rust is required but not installed. Visit https://rustup.rs/"; exit 1; }
docker-compose pull
cargo fetch
@echo "โ
Development environment setup complete!"
migrate:
@echo "๐๏ธ Running database migrations..."
@echo "โ
Migrations completed"
audit:
@echo "๐ Running security audit..."
cargo audit
profile:
@echo "๐ Running performance profile..."
cargo build --release
perf record --call-graph=dwarf target/release/syros
perf report
load-test:
@echo "โก Running load tests..."
@command -v wrk >/dev/null 2>&1 || { echo "โ wrk is required for load testing. Install with: sudo apt-get install wrk"; exit 1; }
wrk -t12 -c400 -d30s --latency http://localhost:8080/health
deps:
@echo "๐ฆ Installing dependencies..."
cargo fetch
@echo "โ
Dependencies installed"
check: fmt lint test audit
@echo "โ
All checks passed!"
ci: check bench
@echo "โ
CI pipeline completed successfully!"
quick-start: setup build run
@echo "๐ Syros is running!"
@echo "๐ Check examples/ directory for usage examples"
@echo "๐ Documentation: cargo doc --open"