-
Notifications
You must be signed in to change notification settings - Fork 59
Expand file tree
/
Copy pathmakefile
More file actions
64 lines (44 loc) · 1.5 KB
/
makefile
File metadata and controls
64 lines (44 loc) · 1.5 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
53
54
55
56
57
58
59
60
61
62
63
64
// Makefile
.PHONY: help install build start dev test clean docker-up docker-down migrate backup restore
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)
install: ## Install dependencies
npm install
build: ## Build the application
npm run build
start: ## Start the application in production mode
npm start
dev: ## Start the application in development mode
npm run dev
test: ## Run tests
npm test
test-db: ## Run tests with database setup
npm run test:db
clean: ## Clean build artifacts
rm -rf dist coverage
docker-up: ## Start Docker containers
docker-compose up -d
docker-down: ## Stop Docker containers
docker-compose down
docker-logs: ## View Docker logs
docker-compose logs -f
migrate: ## Run database migrations
npm run migration:run
migrate-revert: ## Revert last migration
npm run migration:revert
migrate-generate: ## Generate new migration
@read -p "Enter migration name: " name; \
npm run migration:generate src/migrations/$name
backup: ## Create database backup
npm run db:backup create
restore: ## Restore database backup
@read -p "Enter backup file path: " file; \
npm run db:restore $file
setup: install docker-up migrate ## Complete setup (install, docker, migrate)
health: ## Check application health
curl -s http://localhost:3000/health | jq .
metrics: ## Get application metrics
curl -s http://localhost:3000/health/metrics | jq .