-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
97 lines (80 loc) · 2.31 KB
/
Makefile
File metadata and controls
97 lines (80 loc) · 2.31 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
# Makefile for the Rust project
# Variables
PROJECT_ID := $(shell gcloud config get-value project)
SERVICE_NAME := stdiokey
REGION := us-central1
.PHONY: all build run clean release test fmt clippy check docker-build deploy help info disk
# The default target
all: build
# Build the project for development
build:
@echo "Building the Rust project..."
@cargo build
# Run the MCP server (Stdio)
run:
@if [ -z "$(KEY)" ]; then echo "Error: KEY is undefined. Usage: make run KEY=<your_api_key>"; exit 1; fi
@echo "Running the MCP Stdio server..."
@cargo run --release -- --key $(KEY)
# Get system info directly
info:
@cargo run --quiet -- info
# Get disk usage directly
disk:
@cargo run --quiet -- disk
# Clean the project
clean:
@echo "Cleaning the project..."
@cargo clean
# Build the project for release
release:
@echo "Building Release..."
@cargo build --release
# Run tests
test:
@echo "Running tests..."
@cargo test
# Format the code
fmt:
@echo "Formatting code..."
@cargo fmt --all -- --check
# Lint the code
clippy:
@echo "Linting code..."
@cargo clippy -- -D warnings
# Lint the code
lint:
@echo "Linting code..."
@cargo clippy -- -D warnings
# Check the code
check:
@echo "Checking the code..."
@cargo check
# Build the Docker image
docker-build:
@echo "Building the Docker image..."
@docker build -t gcr.io/$(gcloud config get-value project)/$(SERVICE_NAME):latest .
# Submit the build to Google Cloud Build
deploy:
@echo "Submitting build to Google Cloud Build..."
@cargo clean
@gcloud builds submit . --config cloudbuild.yaml
help:
@echo "Makefile for the Rust project"
@echo ""
@echo "Usage:"
@echo " make <target>"
@echo ""
@echo "Targets:"
@echo " all (default) same as 'build'"
@echo " build Build the project for development"
@echo " run Run the MCP Stdio server"
@echo " info Display system information report directly"
@echo " disk Display disk usage report directly"
@echo " clean Clean the project"
@echo " release Build the project for release"
@echo " test Run tests"
@echo " fmt Check formatting"
@echo " clippy Lint the code"
@echo " check Check the code"
@echo " docker-build Build the Docker image"
@echo " deploy Submit the build to Google Cloud Build"