-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
56 lines (39 loc) · 1.38 KB
/
Makefile
File metadata and controls
56 lines (39 loc) · 1.38 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
.PHONY: run test test-integration lint build deploy clean docker-build docker-run help
# Default target
.DEFAULT_GOAL := help
# Variables
BINARY_NAME=lesswrong-bot
DOCKER_IMAGE=lesswrong-bot
run: ## Run the application
env $$(cat .env | xargs) go run .
test: ## Run tests with race detection
go test -race ./...
test-integration: ## Run integration tests
env $$(cat .env | xargs) go test -race -tags=integration ./...
test-coverage: ## Run tests with coverage
go test -race -coverprofile=coverage.out ./...
go tool cover -html=coverage.out -o coverage.html
lint: ## Run linter
golangci-lint run
build: ## Build the application
go build -o $(BINARY_NAME) .
build-optimized: ## Build with optimizations
go build -ldflags="-w -s" -o $(BINARY_NAME) .
clean: ## Clean build artifacts
rm -f $(BINARY_NAME)
rm -f coverage.out coverage.html
deploy: ## Deploy to Heroku
git push heroku main
docker-build: ## Build Docker image
docker build -t $(DOCKER_IMAGE) .
docker-run: ## Run Docker container
docker run -p 9999:9999 $(DOCKER_IMAGE)
go-mod-tidy: ## Tidy go modules
go mod tidy
go-mod-verify: ## Verify go modules
go mod verify
go-mod-download: ## Download go modules
go mod download
help: ## Show this help message
@echo "Available commands:"
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}'