-
-
Notifications
You must be signed in to change notification settings - Fork 640
Expand file tree
/
Copy pathMakefile
More file actions
39 lines (35 loc) · 1.53 KB
/
Makefile
File metadata and controls
39 lines (35 loc) · 1.53 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
# Default target
.DEFAULT_GOAL := help
# ==============================================================================
# Run & Development
# ==============================================================================
.PHONY: run
run: ## Build frontend and run server
@echo "--- Building frontend... ---"
cd web && npm install && npm run build
@echo "--- Preparing backend... ---"
@echo "--- Starting backend... ---"
go run ./main.go
.PHONY: dev
dev: ## Run in development mode (with race detection)
@echo "🔧 Starting development mode..."
go run -race ./main.go
# ==============================================================================
# Key Migration
# ==============================================================================
.PHONY: migrate-keys
migrate-keys: ## Execute key migration (usage: make migrate-keys ARGS="--from old --to new")
@echo "🔑 Executing key migration..."
@if [ -z "$(ARGS)" ]; then \
echo "Usage:"; \
echo " Enable encryption: make migrate-keys ARGS=\"--to new-key\""; \
echo " Disable encryption: make migrate-keys ARGS=\"--from old-key\""; \
echo " Change key: make migrate-keys ARGS=\"--from old-key --to new-key\""; \
echo ""; \
echo "⚠️ Important: Always backup database before migration!"; \
exit 1; \
fi
go run ./main.go migrate-keys $(ARGS)
.PHONY: help
help: ## Display this help message
@awk 'BEGIN {FS = ":.*?## "; printf "Usage:\n make \033[36m<target>\033[0m\n\nTargets:\n"} /^[a-zA-Z0-9_-]+:.*?## / { printf " \033[36m%-20s\033[0m %s\n", $$1, $$2 }' $(MAKEFILE_LIST)