-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
85 lines (68 loc) · 1.9 KB
/
Copy pathMakefile
File metadata and controls
85 lines (68 loc) · 1.9 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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
.PHONY: setup start stop restart logs clean dev rebuild test coverage lint check
# Full Docker setup (database + app)
setup:
@echo "Setting up complete environment..."
@chmod +x scripts/setup.sh
@./scripts/setup.sh
# Start all containers
start:
@echo "Starting all containers..."
@docker compose up -d
# Stop all containers
stop:
@echo "Stopping all containers..."
@docker compose down
# Restart all containers
restart:
@echo "Restarting all containers..."
@docker compose restart
# View logs
logs:
@docker compose logs -f
# View app logs only
logs-app:
@docker compose logs -f app
# View database logs only
logs-db:
@docker compose logs -f postgres
# Clean everything
clean:
@echo "Removing containers and volumes..."
@docker compose down -v
# Development mode (database in Docker, app locally)
dev:
@echo "Starting database only..."
@docker compose up -d postgres pgadmin
@echo "Database ready at localhost:5432"
@echo "pgAdmin ready at http://localhost:5050"
@echo "Run app locally: ./gradlew bootRun --args='--spring.profiles.active=dev'"
# Rebuild and restart app
rebuild:
@echo "Rebuilding application..."
@docker compose up -d --build app
# Run tests
test:
@./gradlew test
# Shell into app container
shell-app:
@docker exec -it syncapi-app sh
# Shell into database container
shell-db:
@docker exec -it syncapi-postgres psql -U syncapi_user -d syncapi_db
# Generate coverage report
coverage:
@./gradlew test jacocoTestReport
@echo "Coverage report: build/reports/jacoco/test/html/index.html"
# Run static analysis
lint:
@./gradlew checkstyleMain spotbugsMain
@echo "Checkstyle report: build/reports/checkstyle/main.html"
@echo "SpotBugs report: build/reports/spotbugs/main.html"
# Run the full verification lifecycle
check:
@./gradlew check
hooks:
@mkdir -p .git/hooks
@cp scripts/hooks/pre-commit .git/hooks/pre-commit
@chmod +x .git/hooks/pre-commit
@echo "Git pre-commit hook installed."