-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
77 lines (60 loc) · 1.46 KB
/
Copy pathMakefile
File metadata and controls
77 lines (60 loc) · 1.46 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
75
76
77
.PHONY: build run test clean docker-build docker-up docker-down docker-logs css css-watch
# Binary name
BINARY=caddyshack
# Go parameters
GOCMD=go
GOBUILD=$(GOCMD) build
GORUN=$(GOCMD) run
GOTEST=$(GOCMD) test
GOCLEAN=$(GOCMD) clean
# Build the binary
build:
$(GOBUILD) -o $(BINARY) ./cmd/caddyshack
# Run the application locally
run:
$(GORUN) ./cmd/caddyshack
# Run tests
test:
$(GOTEST) -v ./...
# Run tests with coverage
test-coverage:
$(GOTEST) -v -cover -coverprofile=coverage.out ./...
$(GOCMD) tool cover -html=coverage.out -o coverage.html
# Clean build artifacts
clean:
$(GOCLEAN)
rm -f $(BINARY)
rm -f coverage.out coverage.html
# Build Docker image
docker-build:
docker build -t $(BINARY) .
# Start development environment
docker-up:
docker compose -f docker-compose.dev.yml up -d
# Stop development environment
docker-down:
docker compose -f docker-compose.dev.yml down
# View logs from development environment
docker-logs:
docker compose -f docker-compose.dev.yml logs -f
# Rebuild and restart development environment
docker-rebuild:
docker compose -f docker-compose.dev.yml down
docker compose -f docker-compose.dev.yml build
docker compose -f docker-compose.dev.yml up -d
# Format code
fmt:
$(GOCMD) fmt ./...
# Run linter
lint:
golangci-lint run
# Install development dependencies
deps:
$(GOCMD) mod download
$(GOCMD) mod tidy
# Build Tailwind CSS (production)
css:
npm run build
# Watch Tailwind CSS (development)
css-watch:
npm run watch