Repository navigation
Expand file tree
/
Copy pathMakefile
More file actions
74 lines (57 loc) · 1.39 KB
/
Copy pathMakefile
File metadata and controls
74 lines (57 loc) · 1.39 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
.PHONY: build run clean docker-build docker-push test fmt vet docs-generate website-docker-build
# Variables
BINARY_NAME=docktail
DOCKER_IMAGE=ghcr.io/marvinvr/docktail
VERSION?=latest
# Build the binary
build:
go build -o $(BINARY_NAME) .
# Run the application locally
run: build
./$(BINARY_NAME)
# Clean build artifacts
clean:
go clean
rm -f $(BINARY_NAME)
# Build Docker image
docker-build:
docker build --build-arg VERSION=$(VERSION) -t $(DOCKER_IMAGE):$(VERSION) .
# Generate website documentation from docs/*.md
docs-generate:
go run ./tools/docsgen
# Build website image from the repository root context
website-docker-build:
docker build -f website/Dockerfile .
# Push Docker image
docker-push: docker-build
docker push $(DOCKER_IMAGE):$(VERSION)
# Run tests
test:
go test -v ./...
# Format code
fmt:
go fmt ./...
# Run go vet
vet:
go vet ./...
# Install dependencies
deps:
go mod download
go mod tidy
# Run all checks
check: fmt vet test
# Build for multiple platforms
build-all:
GOOS=linux GOARCH=amd64 go build -o $(BINARY_NAME)-linux-amd64 .
GOOS=linux GOARCH=arm64 go build -o $(BINARY_NAME)-linux-arm64 .
GOOS=darwin GOARCH=amd64 go build -o $(BINARY_NAME)-darwin-amd64 .
GOOS=darwin GOARCH=arm64 go build -o $(BINARY_NAME)-darwin-arm64 .
# Start docker-compose
up:
docker compose up -d
# Stop docker-compose
down:
docker compose down
# View logs
logs:
docker logs -f docktail