-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
219 lines (173 loc) · 7.34 KB
/
Makefile
File metadata and controls
219 lines (173 loc) · 7.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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
# Resume Processor MCP Server Makefile
# Author: Open Systems Lab <info@opensystemslab.com>
# Go parameters
GOCMD=go
GOBUILD=$(GOCMD) build
GOCLEAN=$(GOCMD) clean
GOTEST=$(GOCMD) test
GOGET=$(GOCMD) get
GOMOD=$(GOCMD) mod
# Build parameters
BINARY_NAME=resume-processor-mcp
BINARY_UNIX=$(BINARY_NAME)_unix
BINARY_WINDOWS=$(BINARY_NAME).exe
BINARY_DARWIN=$(BINARY_NAME)_darwin
# Version info
VERSION ?= 1.0.0
BUILD_TIME=$(shell date -u '+%Y-%m-%d_%H:%M:%S')
GIT_COMMIT=$(shell git rev-parse --short HEAD)
# Ldflags
LDFLAGS=-ldflags "-X main.version=$(VERSION) -X main.buildTime=$(BUILD_TIME) -X main.gitCommit=$(GIT_COMMIT)"
# Docker parameters
DOCKER_IMAGE=resume-processor-mcp
DOCKER_TAG=latest
.PHONY: all build build-linux build-windows build-darwin build-all clean clean-docker clean-all \
test test-unit test-integration test-mcp test-act test-act-full test-all test-coverage \
run run-stdio benchmark deps deps-update deps-vendor lint fmt vet \
docker-build docker-run docker-push install install-tools \
integration-setup integration-test mcp-setup mcp-test \
pipeline-setup pipeline-test process-resume help
all: test build
## Build Commands
build: ## Build the binary
$(GOBUILD) $(LDFLAGS) -o $(BINARY_NAME) ./cmd/server
build-linux: ## Build for Linux
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 $(GOBUILD) $(LDFLAGS) -o $(BINARY_UNIX) ./cmd/server
build-windows: ## Build for Windows
CGO_ENABLED=0 GOOS=windows GOARCH=amd64 $(GOBUILD) $(LDFLAGS) -o $(BINARY_WINDOWS) ./cmd/server
build-darwin: ## Build for macOS
CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 $(GOBUILD) $(LDFLAGS) -o $(BINARY_DARWIN) ./cmd/server
build-all: build-linux build-windows build-darwin ## Build for all platforms
## Development Commands
run: build ## Build and run the server
./$(BINARY_NAME) serve --log-level debug
run-stdio: build ## Build and run in stdio mode
./$(BINARY_NAME) stdio --log-level debug
## Testing Commands
test-unit: ## Run Go unit tests
$(GOTEST) -v ./...
test-mcp: build ## Run MCP server tests
@echo "Running MCP server tests..."
./scripts/testing/test-mcp.sh
test-act: ## Run ACT pipeline tests
@echo "Running ACT pipeline tests..."
./scripts/testing/test-act.sh
test-act-full: ## Run ACT pipeline tests with Docker builds
@echo "Running full ACT pipeline tests..."
./scripts/testing/test-act.sh --full
test-integration: build ## Run all integration tests
@echo "Running all integration tests..."
./scripts/testing/run-tests.sh
test-all: test-unit test-integration ## Run all tests (unit + integration)
test: test-unit ## Default test target (unit tests only)
test-coverage: ## Run tests with coverage
$(GOTEST) -v -coverprofile=coverage.out ./...
$(GOCMD) tool cover -html=coverage.out -o coverage.html
benchmark: ## Run benchmarks
$(GOTEST) -bench=. -benchmem ./...
## Dependency Management
deps: ## Download dependencies
$(GOMOD) download
$(GOMOD) verify
deps-update: ## Update dependencies
$(GOMOD) tidy
$(GOGET) -u ./...
deps-vendor: ## Vendor dependencies
$(GOMOD) vendor
## Code Quality
lint: ## Run linter
golangci-lint run ./...
fmt: ## Format code
$(GOCMD) fmt ./...
vet: ## Run go vet
$(GOCMD) vet ./...
## Docker Commands
docker-build: ## Build Docker image
docker build -t $(DOCKER_IMAGE):$(DOCKER_TAG) .
docker-run: ## Run Docker container
docker run -p 8080:8080 $(DOCKER_IMAGE):$(DOCKER_TAG)
docker-push: ## Push Docker image
docker push $(DOCKER_IMAGE):$(DOCKER_TAG)
## Integration Commands
integration-setup: ## Setup scripts directory for integration
@echo "Verifying scripts directory setup..."
@test -f scripts/process_resume.sh || { echo "scripts/process_resume.sh not found"; exit 1; }
@test -f scripts/linkedin_template_generator.py || { echo "scripts/linkedin_template_generator.py not found"; exit 1; }
@test -f scripts/requirements.txt || { echo "scripts/requirements.txt not found"; exit 1; }
@chmod +x scripts/process_resume.sh
@echo "✅ Scripts directory setup verified"
integration-test: build integration-setup ## Run integration tests
./$(BINARY_NAME) serve --work-dir . --log-level debug &
SERVER_PID=$$!; \
sleep 2; \
curl -f http://localhost:8080/health || (kill $$SERVER_PID && exit 1); \
kill $$SERVER_PID
## MCP Configuration
mcp-setup: build ## Setup MCP configuration
@echo "Setting up MCP configuration..."
@echo "Binary location: $(shell pwd)/$(BINARY_NAME)"
@echo "Copy the following to your Claude configuration:"
@echo ""
@cat mcp-config.json | jq '.claude'
mcp-test: build ## Test MCP functionality
@echo '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"test-client","version":"1.0.0"}}}' | ./$(BINARY_NAME) stdio
## Resume Pipeline Integration
pipeline-setup: ## Setup resume processing pipeline
@echo "Checking pipeline dependencies..."
@command -v pandoc >/dev/null 2>&1 || { echo "pandoc not found. Install with: brew install pandoc"; exit 1; }
@command -v pdflatex >/dev/null 2>&1 || { echo "pdflatex not found. Install with: brew install --cask mactex"; exit 1; }
@command -v python3 >/dev/null 2>&1 || { echo "python3 not found. Install with: brew install python3"; exit 1; }
@python3 -c "import requirements" 2>/dev/null || pip3 install -r scripts/requirements.txt
@echo "✅ Pipeline dependencies satisfied"
process-resume: ## Process resume using scripts/process_resume.sh
@echo "Running resume processing script..."
@test -f scripts/process_resume.sh || { echo "scripts/process_resume.sh not found"; exit 1; }
@chmod +x scripts/process_resume.sh
./scripts/process_resume.sh
pipeline-test: build pipeline-setup ## Test resume processing pipeline
@echo "Testing resume processing pipeline..."
@echo "# Test Resume\n\n## Career Summary\nTest summary\n\n## Experience\n- Test experience" > test-resume.md
./$(BINARY_NAME) stdio --work-dir . < test-mcp-request.json
@rm -f test-resume.md
## Clean Commands
clean: ## Clean build artifacts
$(GOCLEAN)
rm -f $(BINARY_NAME)
rm -f $(BINARY_UNIX)
rm -f $(BINARY_WINDOWS)
rm -f $(BINARY_DARWIN)
rm -f coverage.out
rm -f coverage.html
clean-docker: ## Clean Docker images
docker rmi $(DOCKER_IMAGE):$(DOCKER_TAG) || true
clean-all: clean clean-docker ## Clean everything
## Install Commands
install: build ## Install binary to $GOPATH/bin
cp $(BINARY_NAME) $(GOPATH)/bin/
install-tools: ## Install development tools
$(GOGET) -u github.com/golangci/golangci-lint/cmd/golangci-lint
## Help
help: ## Display this help
@echo "Resume Processor MCP Server"
@echo "==========================="
@echo ""
@echo "Available commands:"
@echo ""
@awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z_-]+:.*?## / {printf " \033[36m%-20s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST)
@echo ""
@echo "Examples:"
@echo " make build # Build the binary"
@echo " make run # Build and run server"
@echo " make test # Run unit tests"
@echo " make test-all # Run all tests (unit + integration)"
@echo " make test-mcp # Run MCP server tests"
@echo " make test-act # Run ACT pipeline tests"
@echo " make process-resume # Run resume processing script"
@echo " make docker-build # Build Docker image"
@echo " make mcp-setup # Setup MCP configuration"
@echo ""
@echo "Version: $(VERSION)"
@echo "Build Time: $(BUILD_TIME)"
@echo "Git Commit: $(GIT_COMMIT)"
# Default target
.DEFAULT_GOAL := help