-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
61 lines (46 loc) · 1.11 KB
/
Makefile
File metadata and controls
61 lines (46 loc) · 1.11 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
.PHONY: build run test clean docker-build docker-up docker-down
# Build the application
build:
go build -o bin/comment ./cmd/main.go
# Run the application
run:
go run ./cmd/main.go
# Run tests
test:
go test -v ./...
# Run tests with coverage
test-coverage:
go test -v -coverprofile=coverage.out ./...
go tool cover -html=coverage.out -o coverage.html
# Clean build artifacts
clean:
rm -rf bin/
rm -f coverage.out coverage.html
# Format code
fmt:
go fmt ./...
# Run linter
lint:
golangci-lint run
# Download dependencies
deps:
go mod download
go mod tidy
# Docker commands
docker-build:
docker build -t minisource/comment:latest .
docker-up:
docker-compose up -d
docker-down:
docker-compose down
docker-dev:
docker-compose -f docker-compose.dev.yml up -d
docker-logs:
docker-compose logs -f comment
# Generate Swagger documentation
swagger:
@echo "Generating Swagger documentation..."
@swag init -g cmd/main.go -o docs --parseDependency --parseInternal
# Generate mocks (if needed)
mocks:
mockgen -source=internal/usecase/comment_usecase.go -destination=internal/mocks/mock_notifier.go -package=mocks