-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
63 lines (49 loc) · 1.78 KB
/
Makefile
File metadata and controls
63 lines (49 loc) · 1.78 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
BINARY_NAME=watcher
DOCKER_COMPOSE=docker-compose
.PHONY: all build run test clean docker-up docker-down migrate-up migrate-down lint
all: build
build:
@echo "Building $(BINARY_NAME)..."
@go build -o bin/$(BINARY_NAME) ./cmd/watcher
install: build
@echo "Installing $(BINARY_NAME) to $(GOPATH)/bin..."
@cp bin/$(BINARY_NAME) $(shell go env GOPATH)/bin/
run: build
@echo "Running $(BINARY_NAME)..."
@./bin/$(BINARY_NAME)
test:
@echo "Running unit and integration tests..."
@go test -v ./internal/...
test-e2e:
@echo "Running live E2E tests (requires E2E_LIVE=true)..."
@E2E_LIVE=true go test -v ./tests/e2e/...
clean:
@echo "Cleaning..."
@rm -rf bin/
@go clean
lint:
@echo "Running linter..."
@golangci-lint run
docker-up:
@echo "Starting docker services..."
@$(DOCKER_COMPOSE) up -d
docker-down:
@echo "Stopping docker services..."
@$(DOCKER_COMPOSE) down
migrate-up:
@echo "Running migrations..."
@go run github.com/pressly/goose/v3/cmd/goose -dir migrations postgres "postgres://watcher:watcher123@localhost:5432/watcher?sslmode=disable" up
migrate-down:
@echo "Rolling back migrations..."
@go run github.com/pressly/goose/v3/cmd/goose -dir migrations postgres "postgres://watcher:watcher123@localhost:5432/watcher?sslmode=disable" down
help:
@echo "Available commands:"
@echo " make build - Build the application"
@echo " make install - Build and install to GOPATH/bin"
@echo " make run - Build and run the application"
@echo " make test - Run tests"
@echo " make clean - Clean build artifacts"
@echo " make docker-up - Start Docker dependencies"
@echo " make docker-down - Stop Docker dependencies"
@echo " make migrate-up - Run database migrations"
@echo " make migrate-down - Rollback database migrations"