- Set up cobra CLI with all commands (backup, restore, prune, verify, fetch) - Integrate uber/fx for dependency injection and lifecycle management - Add globals package with build-time variables (Version, Commit) - Implement config loading from YAML with validation - Create core data models (FileInfo, ChunkInfo, BlobInfo, Snapshot) - Add Makefile with build, test, lint, and clean targets - Include minimal test suite for compilation verification - Update documentation with --quick flag for verify command - Fix markdown numbering in implementation TODO
47 lines
994 B
Makefile
47 lines
994 B
Makefile
.PHONY: test fmt lint build clean all
|
|
|
|
# Build variables
|
|
VERSION := $(shell git describe --tags --always --dirty 2>/dev/null || echo "dev")
|
|
COMMIT := $(shell git rev-parse HEAD 2>/dev/null || echo "unknown")
|
|
|
|
# Linker flags
|
|
LDFLAGS := -X 'git.eeqj.de/sneak/vaultik/internal/globals.Version=$(VERSION)' \
|
|
-X 'git.eeqj.de/sneak/vaultik/internal/globals.Commit=$(COMMIT)'
|
|
|
|
# Default target
|
|
all: test
|
|
|
|
# Run tests
|
|
test: lint
|
|
go test -v ./...
|
|
|
|
# Format code
|
|
fmt:
|
|
go fmt ./...
|
|
|
|
# Run linter
|
|
lint:
|
|
golangci-lint run
|
|
|
|
# Build binary
|
|
build:
|
|
go build -ldflags "$(LDFLAGS)" -o vaultik ./cmd/vaultik
|
|
|
|
# Clean build artifacts
|
|
clean:
|
|
rm -f vaultik
|
|
go clean
|
|
|
|
# Install dependencies
|
|
deps:
|
|
go mod download
|
|
go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest
|
|
|
|
# Run tests with coverage
|
|
test-coverage:
|
|
go test -v -coverprofile=coverage.out ./...
|
|
go tool cover -html=coverage.out -o coverage.html
|
|
|
|
# Run integration tests
|
|
test-integration:
|
|
go test -v -tags=integration ./...
|