-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
69 lines (49 loc) · 2.09 KB
/
Makefile
File metadata and controls
69 lines (49 loc) · 2.09 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
.PHONY: help dev build test clean docker-up docker-down
help: ## Show this help
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}'
dev: ## Run in development mode
go run cmd/server/main.go
build: ## Build the application
go build -o bin/marketai cmd/server/main.go
test: ## Run tests
go test -v ./...
clean: ## Clean build files
rm -rf bin/
docker-up: ## Start Docker services
docker-compose up -d
docker-down: ## Stop Docker services
docker-compose down
docker-logs: ## View Docker logs
docker-compose logs -f
up: ## Alias for docker-up
docker-compose up -d
down: ## Alias for docker-down
docker-compose down
logs: ## Alias for docker-logs
docker-compose logs -f
docker-build: ## Build Docker image
docker-compose build
docker-restart: ## Restart Docker services
docker-compose restart
docker-up-monitoring: ## Start Docker services with monitoring (Prometheus + Grafana)
docker-compose -f docker-compose.yml -f docker-compose.monitoring.yml up -d
db-migrate-006: ## Apply migration 006 (data sources) into running Postgres container
docker exec -i marketai-postgres psql -U marketai -d marketai_dev -f /docker-entrypoint-initdb.d/006_data_sources.sql
db-verify-datasources: ## Verify v0.5 tables exist
docker exec -i marketai-postgres psql -U marketai -d marketai_dev -c "SELECT to_regclass('public.price_sources') AS price_sources, to_regclass('public.twitter_sentiment') AS twitter_sentiment, to_regclass('public.scraped_articles') AS scraped_articles;"
install: ## Install dependencies
go mod download
go mod tidy
lint: ## Run linter
golangci-lint run
fmt: ## Format code (gofmt, gofumpt, goimports) and tidy modules
@echo "-> Running go fmt"
go fmt ./...
@echo "-> Running gofumpt (if installed)"
@gofumpt -w . 2>/dev/null || true
@echo "-> Running goimports (if installed)"
@goimports -w . 2>/dev/null || true
@echo "-> Running go mod tidy"
go mod tidy
fmt-check: ## Fail if files are not gofmt'ed
@out=$$(gofmt -s -l .); if [ -n "$$out" ]; then echo "Unformatted files:"; echo "$$out"; exit 1; fi