-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
50 lines (38 loc) · 998 Bytes
/
Makefile
File metadata and controls
50 lines (38 loc) · 998 Bytes
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
.PHONY: build run test lint clean dev-frontend dev-backend migrate-up migrate-down migrate-create docker-build
# Go parameters
BINARY_NAME=server
GO=go
GOFLAGS=-v
# Build the Go backend
build:
$(GO) build $(GOFLAGS) -o bin/$(BINARY_NAME) ./cmd/server
# Run the Go backend
run: build
./bin/$(BINARY_NAME)
# Run Go tests
test:
$(GO) test ./... -v
# Run Go linter (requires golangci-lint)
lint:
golangci-lint run ./...
# Clean build artifacts
clean:
rm -rf bin/
rm -rf web/dist/
# Start Vue dev server
dev-frontend:
cd web && npm run dev
# Start Go backend in dev mode
dev-backend:
$(GO) run ./cmd/server
# Database migrations (requires golang-migrate CLI)
migrate-up:
migrate -path migrations -database "$$DATABASE_URL" up
migrate-down:
migrate -path migrations -database "$$DATABASE_URL" down 1
migrate-create:
@read -p "Migration name: " name; \
migrate create -ext sql -dir migrations -seq $$name
# Build Docker image
docker-build:
docker build -t warzone-stats-tracker .