-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
74 lines (54 loc) · 1.94 KB
/
Copy pathMakefile
File metadata and controls
74 lines (54 loc) · 1.94 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 test clean fmt lint help
# Binary name
BINARY=vos
# Build directory
BUILD_DIR=bin
# Go parameters
GOCMD=go
GOBUILD=$(GOCMD) build
GOTEST=$(GOCMD) test
GOCLEAN=$(GOCMD) clean
GOGET=$(GOCMD) get
GOMOD=$(GOCMD) mod
GOFMT=gofmt
# Build flags
LDFLAGS=-ldflags "-s -w"
help: ## Show this help
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-15s\033[0m %s\n", $$1, $$2}'
build: ## Build the binary
mkdir -p $(BUILD_DIR)
$(GOBUILD) $(LDFLAGS) -o $(BUILD_DIR)/$(BINARY) ./cmd/vos
run: build ## Build and run the server
./$(BUILD_DIR)/$(BINARY) serve --config config.yaml
test:
$(GOTEST) -v ./...
test-azblob: ## Run integration tests with Azure Blob Storage backend only
BACKEND=azblob $(GOTEST) -v ./tests/integration/...
test-aws-s3: ## Run integration tests with AWS S3 backend only
BACKEND=aws-s3 $(GOTEST) -v ./tests/integration/...
test-gcs: ## Run integration tests with Google Cloud Storage backend only
BACKEND=gcs $(GOTEST) -v ./tests/integration/...
test-coverage: ## Run unit and integration tests with coverage
@echo "Running all tests with coverage..."
$(GOTEST) -v -coverprofile=coverage.out -coverpkg=./... ./...
$(GOCMD) tool cover -html=coverage.out -o coverage.html
@echo "Coverage report: coverage.html"
coverage-badge: ## Generate coverage badge from coverage.out
@./scripts/coverage-badge.sh coverage.out .github/badges/coverage.svg
clean: ## Clean build artifacts
$(GOCLEAN)
rm -rf $(BUILD_DIR)
rm -f coverage.out coverage.html integration.test
fmt: ## Format code
$(GOFMT) -s -w .
lint: ## Run linter
golangci-lint run
deps: ## Download dependencies
$(GOMOD) download
$(GOMOD) tidy
dev: ## Run in development mode with auto-reload (requires air)
air
docker-build: ## Build Docker image
docker build -t variobjectstorage:latest .
docker-run: ## Run Docker container
docker run -p 8080:8080 -v $(PWD)/config.yaml:/app/config.yaml variobjectstorage:latest