Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017GpWAskjmYtZpuQ5JwYTX3
38 lines
914 B
Makefile
38 lines
914 B
Makefile
VERSION ?= $(shell git describe --tags --always --dirty 2>/dev/null || echo dev)
|
|
COMMIT ?= $(shell git rev-parse --short HEAD 2>/dev/null || echo none)
|
|
PKG := git.zb-server.de/ZB-Server/uptimesebi
|
|
LDFLAGS := -s -w -X $(PKG)/internal/buildinfo.Version=$(VERSION) -X $(PKG)/internal/buildinfo.Commit=$(COMMIT)
|
|
|
|
.PHONY: generate web build test lint dev-up dev-up-sentinel dev-down migrate image
|
|
|
|
generate:
|
|
sqlc generate
|
|
go tool templ generate
|
|
|
|
web:
|
|
npm run build
|
|
|
|
build: generate web
|
|
CGO_ENABLED=0 go build -trimpath -ldflags "$(LDFLAGS)" -o bin/ ./cmd/...
|
|
|
|
test:
|
|
go test ./...
|
|
|
|
lint:
|
|
golangci-lint run
|
|
|
|
dev-up:
|
|
docker compose up -d --wait
|
|
|
|
dev-up-sentinel:
|
|
docker compose --profile sentinel up -d --wait
|
|
|
|
dev-down:
|
|
docker compose --profile sentinel down
|
|
|
|
migrate:
|
|
go run ./cmd/api migrate up
|
|
|
|
image:
|
|
docker build --build-arg VERSION=$(VERSION) --build-arg COMMIT=$(COMMIT) -t uptimesebi:$(VERSION) .
|