-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
66 lines (50 loc) · 1.24 KB
/
Makefile
File metadata and controls
66 lines (50 loc) · 1.24 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
.PHONY: lint test migrate docker-build clean deps vet
# Default target
all: deps lint test
# Install dependencies
deps:
go mod download
go mod tidy
vet:
go vet ./...
# Run linters
lint:
golangci-lint run
# Run tests
test:
go test -vet=all -v ./...
# Run database migrations
migrate:
goose -dir migrations postgres "user=postgres password=postgres dbname=compaso host=localhost port=5432 sslmode=disable" up
# Docker build
docker-build:
docker build -t compaso:latest .
# Clean build artifacts
clean:
go clean -cache
rm -rf bin/
# Run development environment
dev:
docker-compose -f docker-compose.dev.yml up -d
@echo "Development environment started"
@echo "Run 'make migrate' to set up database schema"
run:
@export $$(cat .env | grep -v '^#' | xargs) && go run cmd/main.go
# Stop development environment
dev-stop:
docker-compose -f docker-compose.dev.yml down
# Run with hot reload (requires air)
watch:
air -c .air.toml
# Security scan
security:
gosec ./...
govulncheck ./...
# Generate documentation
docs:
godoc -http=:6060
# Install development tools
tools:
go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest
go install github.com/pressly/goose/v3/cmd/goose@latest
go install github.com/air-verse/air@latest