mirror of
https://github.com/wahyd4/passkey-auth.git
synced 2026-08-08 20:15:44 +10:00
68 lines
1.8 KiB
Makefile
68 lines
1.8 KiB
Makefile
.PHONY: help build run dev test clean docker-build docker-run k8s-deploy k8s-undeploy
|
|
|
|
help: ## Show this help message
|
|
@echo 'Usage: make [target]'
|
|
@echo ''
|
|
@echo 'Targets:'
|
|
@awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z_-]+:.*?## / {printf " %-15s %s\n", $$1, $$2}' $(MAKEFILE_LIST)
|
|
|
|
build: ## Build the Go binary
|
|
@echo "🔨 Building..."
|
|
@go build -o bin/passkey-auth .
|
|
|
|
run: build ## Run the application locally
|
|
@echo "🚀 Running..."
|
|
@./bin/passkey-auth
|
|
|
|
dev: ## Run in development mode with hot reload
|
|
@echo "🔧 Starting development server..."
|
|
@./scripts/dev.sh
|
|
|
|
test: ## Run tests
|
|
@echo "🧪 Running tests..."
|
|
@go test -v ./...
|
|
|
|
clean: ## Clean build artifacts
|
|
@echo "🧹 Cleaning..."
|
|
@rm -rf bin/
|
|
@rm -f *.db
|
|
|
|
docker-build: ## Build Docker image
|
|
@echo "🐳 Building Docker image..."
|
|
@docker build -t passkey-auth:latest .
|
|
|
|
docker-run: docker-build ## Run with Docker Compose
|
|
@echo "🐳 Starting with Docker Compose..."
|
|
@mkdir -p data
|
|
@docker-compose up -d
|
|
@echo "Access the application at http://localhost:8080"
|
|
|
|
docker-stop: ## Stop Docker Compose
|
|
@echo "🛑 Stopping Docker Compose..."
|
|
@docker-compose down
|
|
|
|
k8s-deploy: docker-build ## Deploy to Kubernetes
|
|
@echo "☸️ Deploying to Kubernetes..."
|
|
@./scripts/deploy.sh
|
|
|
|
k8s-undeploy: ## Remove from Kubernetes
|
|
@echo "☸️ Removing from Kubernetes..."
|
|
@./scripts/undeploy.sh
|
|
|
|
deps: ## Download dependencies
|
|
@echo "📦 Downloading dependencies..."
|
|
@go mod download
|
|
@go mod tidy
|
|
|
|
fmt: ## Format code
|
|
@echo "🎨 Formatting code..."
|
|
@go fmt ./...
|
|
|
|
lint: ## Run linter with auto-fix (excluding test files)
|
|
@echo "🔍 Running linter with auto-fix (excluding test files)..."
|
|
@golangci-lint run --fix --tests=false
|
|
|
|
security: ## Run security scan
|
|
@echo "🔒 Running security scan..."
|
|
@gosec ./...
|