-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
43 lines (36 loc) · 1.23 KB
/
Makefile
File metadata and controls
43 lines (36 loc) · 1.23 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
.PHONY: migrate migrate\:checksum interfaces ent tests fmt help
help:
@echo "Available commands:"
@echo " make tests - Run tests"
@echo " make migrate NAME=initial_migration - Create a new migration"
@echo " make migrate:checksum - Regenerate checksum"
@echo " make interfaces - Generate interfaces and mocks"
@echo " make ent - Generate entities"
migrate:
@if [ -z "$(NAME)" ]; then \
echo "❌ Error: NAME parameter is required"; \
echo "Usage: make migrate NAME=your_migration_name"; \
exit 1; \
fi
@echo "Creating migration: $(NAME)"
@go run -mod=mod ./ent/migrate/main.go -name=$(NAME)
migrate\:checksum:
@echo "Regenerating checksum..."
@go run -mod=mod ./ent/migrate/main.go -checksum
interfaces:
@echo "Generating interfaces..."
@go generate ./internal/repositories/...
@go generate ./internal/infrastructure/...
@go generate ./internal/services/...
@go generate ./internal/deployctl/...
@echo "Generating mocks..."
@go run github.com/vektra/mockery/v2@latest
ent:
@echo "Generating entities..."
@go generate ./ent/...
fmt:
@echo "Formatting Go code..."
@go fmt ./...
tests:
@echo "Running tests..."
@go test -v ./...