-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
58 lines (44 loc) · 1.4 KB
/
Copy pathMakefile
File metadata and controls
58 lines (44 loc) · 1.4 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
all: build test
setup:
@./scripts/setup-dev.sh
build: docs
@./scripts/build.sh
run:
@./scripts/run-with-tags.sh cmd/api/main.go
worker:
@./scripts/run-with-tags.sh cmd/worker/main.go
test:
@echo "Testing..."
@go test ./... -v
itest:
@echo "Running integration tests..."
migrate-up:
@echo "Running migrations..."
@./scripts/run-with-tags.sh cmd/migrate/main.go -action=up
migrate-down:
@echo "Rolling back last migration..."
@./scripts/run-with-tags.sh cmd/migrate/main.go -action=down -steps=1
migrate-status:
@echo "Checking migration status..."
@./scripts/run-with-tags.sh cmd/migrate/main.go -action=status
docs:
@echo "Generating Swagger documentation..."
@which swag > /dev/null || (echo "Error: swag is not installed." && echo "Install it with: go install github.com/swaggo/swag/cmd/swag@latest" && exit 1)
@swag fmt
@swag init -g cmd/api/main.go -o docs
format:
@echo "Formatting codebase..."
@echo ""
@echo "Running go fmt..."
@go fmt ./... || echo "WARNING: go fmt encountered issues (continuing...)"
@echo ""
@echo "Running swag fmt..."
@which swag > /dev/null && swag fmt 2>/dev/null || echo "WARNING: swag fmt encountered issues (continuing...)"
@echo ""
@echo "Formatting complete!"
clean:
@echo "Cleaning..."
@rm -rf bin
setup-systemd:
@./scripts/setup-systemd.sh
.PHONY: all setup build run worker test clean itest migrate-up migrate-down migrate-status docs format setup-systemd