forked from tuannvm/slack-mcp-client
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
95 lines (74 loc) · 1.69 KB
/
Makefile
File metadata and controls
95 lines (74 loc) · 1.69 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
.PHONY: build mcp-server test lint fmt clean run vet slack-bot-install slack-bot-build slack-bot-dev slack-bot-start
# Get repository name for binary name
REPO_NAME=$(shell basename $(shell git rev-parse --show-toplevel))
BINARY_NAME=$(REPO_NAME)
BUILD_DIR=./bin
# Go parameters
GOCMD=go
GOBUILD=$(GOCMD) build
GOCLEAN=$(GOCMD) clean
GOTEST=$(GOCMD) test
GOGET=$(GOCMD) get
GOVET=$(GOCMD) vet
GOFMT=gofmt -s -d
GOLINT=golangci-lint
# Build the binary
build:
mkdir -p $(BUILD_DIR)
$(GOBUILD) -o $(BUILD_DIR)/$(BINARY_NAME) ./cmd/
# Build the MCP server binary
mcp-server:
mkdir -p $(BUILD_DIR)
$(GOBUILD) -o $(BUILD_DIR)/mcp-server ./cmd/mcp-server/
# Run the binary
run: build
$(BUILD_DIR)/$(BINARY_NAME)
# Clean build artifacts
clean:
$(GOCLEAN)
rm -rf $(BUILD_DIR)
# Run tests
test:
$(GOTEST) -v ./...
# Check code format
fmt:
$(GOFMT) .
# Apply code formatting changes
fmt-write:
gofmt -s -w .
# Run go vet
vet:
$(GOVET) ./...
# Run linter
lint:
go fmt ./...
$(GOLINT) run ./...
# Check all (format, lint, vet, test)
check: fmt lint vet test
# Install dependencies
deps:
$(GOGET) -v ./...
go mod tidy
# Update dependencies
deps-update:
go get -u ./...
go mod tidy
# Build Docker image
docker-build:
docker build -t $(BINARY_NAME):latest .
# Default target
all: clean build
# Slack bot targets
slack-bot-install:
cd slack-bot && npm install
slack-bot-build: slack-bot-install
cd slack-bot && npm run build
slack-bot-dev: mcp-server
cd slack-bot && npm run dev
slack-bot-start: mcp-server slack-bot-build
cd slack-bot && npm start
# Print current configuration
info:
@echo "Repository name: $(REPO_NAME)"
@echo "Binary name: $(BINARY_NAME)"
@echo "Build directory: $(BUILD_DIR)"