-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
84 lines (69 loc) · 2.34 KB
/
Makefile
File metadata and controls
84 lines (69 loc) · 2.34 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
75
76
77
78
79
80
81
82
83
84
.PHONY: build run clean test fmt vet docker-build
# Binary name
BINARY_NAME=thoughtmesh-runtime
# Build variables
GO=go
GOFLAGS=-v
LDFLAGS=-w -s
# Docker variables
DOCKER_IMAGE=thoughtmesh-runtime
DOCKER_TAG=latest
# Runtime environment variables with sane defaults
THOUGHTMESH_MODEL_CONFIG ?= {"worker":{"provider":"ollama","modelName":"qwen2.5:latest","endpoint":"http://ollama:11434"}}
THOUGHTMESH_OBJECTIVE ?= Successfully launch the new payment feature to production
THOUGHTMESH_KEY_RESULTS ?= ["Achieve 99.9% uptime in the first 30 days post-launch","Onboard 500 active users within the first two weeks","Reduce payment processing time by 25%"]
THOUGHTMESH_TOOLS ?= []
# Build the binary
build:
$(GO) build $(GOFLAGS) -ldflags "$(LDFLAGS)" -o $(BINARY_NAME) .
# Run the application with default environment variables
run: build
THOUGHTMESH_MODEL_CONFIG='$(THOUGHTMESH_MODEL_CONFIG)' \
THOUGHTMESH_OBJECTIVE='$(THOUGHTMESH_OBJECTIVE)' \
THOUGHTMESH_KEY_RESULTS='$(THOUGHTMESH_KEY_RESULTS)' \
THOUGHTMESH_TOOLS='$(THOUGHTMESH_TOOLS)' \
./$(BINARY_NAME)
# Clean build artifacts
clean:
$(GO) clean
rm -f $(BINARY_NAME)
# Run tests
test:
$(GO) test -v ./...
# Format code
fmt:
$(GO) fmt ./...
# Run go vet
vet:
$(GO) vet ./...
# Build Docker image
docker-build:
docker build -t $(DOCKER_IMAGE):$(DOCKER_TAG) .
# Install dependencies
deps:
$(GO) mod download
$(GO) mod tidy
# Run with example environment variables
run-example: build
THOUGHTMESH_MODEL_CONFIG='{"provider":"openai","name":"gpt-4"}' \
THOUGHTMESH_OBJECTIVE="Example objective" \
THOUGHTMESH_KEY_RESULTS='["Result 1","Result 2"]' \
THOUGHTMESH_TOOLS='[{"name":"tool1","config":{}}]' \
./$(BINARY_NAME)
# Development build (without optimization)
dev:
$(GO) build $(GOFLAGS) -o $(BINARY_NAME) .
# Help target
help:
@echo "Available targets:"
@echo " build - Build the binary"
@echo " run - Build and run the application"
@echo " clean - Clean build artifacts"
@echo " test - Run tests"
@echo " fmt - Format code"
@echo " vet - Run go vet"
@echo " docker-build - Build Docker image"
@echo " deps - Download and tidy dependencies"
@echo " run-example - Run with example environment variables"
@echo " dev - Development build (without optimization)"
@echo " help - Show this help message"