chore: Add setup scripts and Makefile for project management
Scripts added: - CloneVendorRepos.sh: Clones all 27 vendor MCP/LSP repositories - BuildAll.sh: Builds all services from docker-compose.yml - CleanVendor.sh: Removes all cloned vendor repositories - StatusCheck.sh: Checks build status of all services Makefile added: - Provides convenient targets for common operations - Integrates all shell scripts into make commands - Targets: help, clone-vendors, build-all, clean-vendor, status, test, logs, ps, up, down Note: vendor/ directory remains gitignored (per .gitignore). CloneVendorRepos.sh creates it automatically.
This commit is contained in:
44
BuildAll.sh
Executable file
44
BuildAll.sh
Executable file
@@ -0,0 +1,44 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# BuildAll.sh
|
||||||
|
# Script to build all MCP/LSP services in KNEL-AIMiddleware
|
||||||
|
|
||||||
|
set -e # Exit on error
|
||||||
|
|
||||||
|
# Colors for output
|
||||||
|
RED='\033[0;31m'
|
||||||
|
GREEN='\033[0;32m'
|
||||||
|
YELLOW='\033[1;33m'
|
||||||
|
BLUE='\033[0;34m'
|
||||||
|
NC='\033[0m' # No Color
|
||||||
|
|
||||||
|
echo -e "${GREEN}=== KNEL-AIMiddleware Build Script ===${NC}"
|
||||||
|
echo ""
|
||||||
|
echo "Building all services..."
|
||||||
|
echo ""
|
||||||
|
|
||||||
|
# Change to project directory
|
||||||
|
cd "$(dirname "${BASH_SOURCE[0]}")"
|
||||||
|
|
||||||
|
# Get list of all services from docker-compose.yml
|
||||||
|
SERVICES=$(docker compose config --services)
|
||||||
|
|
||||||
|
# Build each service
|
||||||
|
for SERVICE in $SERVICES; do
|
||||||
|
echo -e "${BLUE}Building: ${SERVICE}${NC}"
|
||||||
|
if docker compose build "$SERVICE" 2>&1 | tail -5; then
|
||||||
|
echo -e "${GREEN}✓${NC} Successfully built $SERVICE"
|
||||||
|
else
|
||||||
|
echo -e "${RED}✗${NC} Failed to build $SERVICE"
|
||||||
|
echo -e "${YELLOW}Continuing with next service...${NC}"
|
||||||
|
fi
|
||||||
|
echo ""
|
||||||
|
done
|
||||||
|
|
||||||
|
echo -e "${GREEN}=== Build complete! ===${NC}"
|
||||||
|
echo ""
|
||||||
|
echo "To start all services:"
|
||||||
|
echo " docker compose up -d --profile dev"
|
||||||
|
echo ""
|
||||||
|
echo "To check status:"
|
||||||
|
echo " docker ps"
|
||||||
49
CleanVendor.sh
Executable file
49
CleanVendor.sh
Executable file
@@ -0,0 +1,49 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# CleanVendor.sh
|
||||||
|
# Script to remove all cloned vendor repositories
|
||||||
|
|
||||||
|
set -e # Exit on error
|
||||||
|
|
||||||
|
# Colors for output
|
||||||
|
RED='\033[0;31m'
|
||||||
|
GREEN='\033[0;32m'
|
||||||
|
YELLOW='\033[1;33m'
|
||||||
|
NC='\033[0m' # No Color
|
||||||
|
|
||||||
|
echo -e "${YELLOW}=== KNEL-AIMiddleware Vendor Cleanup Script ===${NC}"
|
||||||
|
echo ""
|
||||||
|
echo -e "${RED}WARNING: This will DELETE all cloned vendor repositories!${NC}"
|
||||||
|
echo ""
|
||||||
|
read -p "Are you sure you want to continue? (yes/no): " CONFIRM
|
||||||
|
|
||||||
|
if [ "$CONFIRM" != "yes" ]; then
|
||||||
|
echo "Aborted."
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Vendor directory
|
||||||
|
VENDOR_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/vendor"
|
||||||
|
|
||||||
|
echo ""
|
||||||
|
echo "Removing vendor directories..."
|
||||||
|
echo ""
|
||||||
|
|
||||||
|
# Count removed
|
||||||
|
COUNT=0
|
||||||
|
|
||||||
|
# Remove all directories in vendor/ except .gitkeep
|
||||||
|
for DIR in "$VENDOR_DIR"/*; do
|
||||||
|
if [ -d "$DIR" ]; then
|
||||||
|
DIRNAME=$(basename "$DIR")
|
||||||
|
echo -e "${RED}[DELETE]${NC} $DIRNAME"
|
||||||
|
rm -rf "$DIR"
|
||||||
|
((COUNT++))
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
echo ""
|
||||||
|
echo -e "${GREEN}=== Cleanup complete! Removed $COUNT directories ===${NC}"
|
||||||
|
echo ""
|
||||||
|
echo "To re-clone repositories, run:"
|
||||||
|
echo " ./CloneVendorRepos.sh"
|
||||||
86
CloneVendorRepos.sh
Executable file
86
CloneVendorRepos.sh
Executable file
@@ -0,0 +1,86 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# CloneVendorRepos.sh
|
||||||
|
# Script to clone all vendor MCP/LSP repositories for KNEL-AIMiddleware
|
||||||
|
|
||||||
|
set -e # Exit on error
|
||||||
|
|
||||||
|
# Colors for output
|
||||||
|
RED='\033[0;31m'
|
||||||
|
GREEN='\033[0;32m'
|
||||||
|
YELLOW='\033[1;33m'
|
||||||
|
NC='\033[0m' # No Color
|
||||||
|
|
||||||
|
# Vendor directory
|
||||||
|
VENDOR_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/vendor"
|
||||||
|
|
||||||
|
echo -e "${GREEN}=== KNEL-AIMiddleware Vendor Repository Clone Script ===${NC}"
|
||||||
|
echo ""
|
||||||
|
echo "Vendor directory: $VENDOR_DIR"
|
||||||
|
echo ""
|
||||||
|
|
||||||
|
# Check if vendor directory exists
|
||||||
|
if [ ! -d "$VENDOR_DIR" ]; then
|
||||||
|
echo -e "${YELLOW}Creating vendor directory...${NC}"
|
||||||
|
mkdir -p "$VENDOR_DIR"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Clone repositories (using subshell to avoid associative array issues)
|
||||||
|
clone_repo() {
|
||||||
|
local dir_name="$1"
|
||||||
|
local repo_url="$2"
|
||||||
|
local target_dir="$VENDOR_DIR/$dir_name"
|
||||||
|
|
||||||
|
if [ -d "$target_dir" ]; then
|
||||||
|
echo -e "${YELLOW}[SKIP]${NC} $dir_name (already exists)"
|
||||||
|
else
|
||||||
|
echo -e "${GREEN}[CLONE]${NC} $dir_name from $repo_url"
|
||||||
|
git clone --depth 1 "$repo_url" "$target_dir"
|
||||||
|
|
||||||
|
if [ $? -eq 0 ]; then
|
||||||
|
echo -e "${GREEN}✓${NC} Successfully cloned $dir_name"
|
||||||
|
else
|
||||||
|
echo -e "${RED}✗${NC} Failed to clone $dir_name"
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
echo ""
|
||||||
|
}
|
||||||
|
|
||||||
|
# Clone all repositories
|
||||||
|
clone_repo "KiCAD-MCP-Server" "https://github.com/mixelpixx/KiCAD-MCP-Server.git"
|
||||||
|
clone_repo "blender-mcp" "https://github.com/ahujasid/blender-mcp.git"
|
||||||
|
clone_repo "freecad-mcp" "https://github.com/ahujasid/freecad-mcp.git"
|
||||||
|
clone_repo "context7" "https://github.com/upstash/context7.git"
|
||||||
|
clone_repo "gimp-mcp" "https://github.com/ahujasid/gimp-mcp.git"
|
||||||
|
clone_repo "bash-language-server" "https://github.com/bash-lsp/bash-language-server.git"
|
||||||
|
clone_repo "docker-language-server" "https://github.com/rcjsuen/docker-language-server.git"
|
||||||
|
clone_repo "marksman" "https://github.com/artempyanykh/marksman.git"
|
||||||
|
clone_repo "drawio-mcp-server" "https://github.com/ahujasid/drawio-mcp-server.git"
|
||||||
|
clone_repo "matomo-mcp-client" "https://github.com/ahujasid/matomo-mcp-client.git"
|
||||||
|
clone_repo "imap-mcp" "https://github.com/ahujasid/imap-mcp.git"
|
||||||
|
clone_repo "mcp-redmine" "https://github.com/ahujasid/mcp-redmine.git"
|
||||||
|
clone_repo "ghost-mcp" "https://github.com/ahujasid/ghost-mcp.git"
|
||||||
|
clone_repo "discourse-mcp" "https://github.com/ahujasid/discourse-mcp.git"
|
||||||
|
clone_repo "mcp-cloudron" "https://github.com/ahujasid/mcp-cloudron.git"
|
||||||
|
clone_repo "postizz-MCP" "https://github.com/ahujasid/postizz-MCP.git"
|
||||||
|
clone_repo "snipeit-mcp" "https://github.com/ahujasid/snipeit-mcp.git"
|
||||||
|
clone_repo "nextcloud-mcp-server" "https://github.com/ahujasid/nextcloud-mcp-server.git"
|
||||||
|
clone_repo "docspace-mcp" "https://github.com/ahujasid/docspace-mcp.git"
|
||||||
|
clone_repo "docker-mcp" "https://github.com/ahujasid/docker-mcp.git"
|
||||||
|
clone_repo "kubernetes-mcp-server" "https://github.com/ahujasid/kubernetes-mcp-server.git"
|
||||||
|
clone_repo "ProxmoxMCP" "https://github.com/ahujasid/ProxmoxMCP.git"
|
||||||
|
clone_repo "terraform-mcp-server" "https://github.com/ahujasid/terraform-mcp-server.git"
|
||||||
|
clone_repo "mcp-ansible" "https://github.com/ahujasid/mcp-ansible.git"
|
||||||
|
clone_repo "mcp-server" "https://github.com/Bitwarden/clients.git"
|
||||||
|
clone_repo "mcp-adapter" "https://github.com/ahujasid/mcp-adapter.git"
|
||||||
|
clone_repo "audiobook-mcp-server" "https://github.com/ahujasid/audiobook-mcp-server.git"
|
||||||
|
clone_repo "mcp-server-elasticsearch" "https://github.com/ahujasid/mcp-server-elasticsearch.git"
|
||||||
|
clone_repo "penpot-mcp" "https://github.com/ahujasid/penpot-mcp.git"
|
||||||
|
|
||||||
|
echo -e "${GREEN}=== All repositories cloned successfully! ===${NC}"
|
||||||
|
echo ""
|
||||||
|
echo "Next steps:"
|
||||||
|
echo " 1. Review and configure environment variables in .env"
|
||||||
|
echo " 2. Build and test services: docker compose build <service-name>"
|
||||||
|
echo " 3. Start services: docker compose up -d --profile dev"
|
||||||
63
Makefile
Normal file
63
Makefile
Normal file
@@ -0,0 +1,63 @@
|
|||||||
|
# Makefile for KNEL-AIMiddleware
|
||||||
|
# Common operations for building, managing, and deploying MCP/LSP services
|
||||||
|
|
||||||
|
.PHONY: help build-all clean-vendor clone-vendors status test
|
||||||
|
|
||||||
|
# Default target
|
||||||
|
help: ## Show this help message
|
||||||
|
@echo 'Usage: make [target]'
|
||||||
|
@echo ''
|
||||||
|
@echo 'Available targets:'
|
||||||
|
@awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z_-]+:.*?## / {printf " \033[36m%-20s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST)
|
||||||
|
|
||||||
|
clone-vendors: ## Clone all vendor MCP/LSP repositories
|
||||||
|
@echo "Cloning all vendor repositories..."
|
||||||
|
@./CloneVendorRepos.sh
|
||||||
|
|
||||||
|
build-all: ## Build all MCP/LSP services
|
||||||
|
@echo "Building all services..."
|
||||||
|
@./BuildAll.sh
|
||||||
|
|
||||||
|
clean-vendor: ## Remove all cloned vendor repositories
|
||||||
|
@echo "Cleaning vendor directory..."
|
||||||
|
@./CleanVendor.sh
|
||||||
|
|
||||||
|
status: ## Check build status of all services
|
||||||
|
@echo "Checking service status..."
|
||||||
|
@./StatusCheck.sh
|
||||||
|
|
||||||
|
test: ## Run tests for all services (if available)
|
||||||
|
@echo "Running tests..."
|
||||||
|
@docker compose config --quiet && echo "✓ docker-compose.yml is valid"
|
||||||
|
|
||||||
|
logs: ## Show logs from all running services
|
||||||
|
@docker compose logs -f
|
||||||
|
|
||||||
|
ps: ## Show status of all services
|
||||||
|
@docker compose ps
|
||||||
|
|
||||||
|
up: ## Start all services in dev profile
|
||||||
|
@echo "Starting all services..."
|
||||||
|
@docker compose up -d --profile dev
|
||||||
|
|
||||||
|
down: ## Stop all services
|
||||||
|
@echo "Stopping all services..."
|
||||||
|
@docker compose down
|
||||||
|
|
||||||
|
rebuild: SERVICE? ## Rebuild a specific service (usage: make rebuild SERVICE=service-name)
|
||||||
|
@echo "Rebuilding $(SERVICE)..."
|
||||||
|
@docker compose build --no-cache $(SERVICE)
|
||||||
|
@docker compose up -d $(SERVICE)
|
||||||
|
|
||||||
|
# Service-specific build targets
|
||||||
|
build-context7: ## Build context7-mcp service
|
||||||
|
@docker compose build context7-mcp
|
||||||
|
|
||||||
|
build-bash-language-server: ## Build bash-language-server service
|
||||||
|
@docker compose build bash-language-server
|
||||||
|
|
||||||
|
build-docker-language-server: ## Build docker-language-server service
|
||||||
|
@docker compose build docker-language-server
|
||||||
|
|
||||||
|
build-marksman: ## Build marksman service
|
||||||
|
@docker compose build marksman
|
||||||
65
StatusCheck.sh
Executable file
65
StatusCheck.sh
Executable file
@@ -0,0 +1,65 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# StatusCheck.sh
|
||||||
|
# Script to check build status of all MCP/LSP services
|
||||||
|
|
||||||
|
set -e # Exit on error
|
||||||
|
|
||||||
|
# Colors for output
|
||||||
|
GREEN='\033[0;32m'
|
||||||
|
RED='\033[0;31m'
|
||||||
|
YELLOW='\033[1;33m'
|
||||||
|
BLUE='\033[0;34m'
|
||||||
|
NC='\033[0m' # No Color
|
||||||
|
|
||||||
|
echo -e "${BLUE}=== KNEL-AIMiddleware Service Status Check ===${NC}"
|
||||||
|
echo ""
|
||||||
|
|
||||||
|
# Change to project directory
|
||||||
|
cd "$(dirname "${BASH_SOURCE[0]}")"
|
||||||
|
|
||||||
|
# Get list of all services from docker-compose.yml
|
||||||
|
SERVICES=$(docker compose config --services | sort)
|
||||||
|
|
||||||
|
# Counters
|
||||||
|
TOTAL=0
|
||||||
|
BUILT=0
|
||||||
|
NOT_BUILT=0
|
||||||
|
|
||||||
|
echo "Checking Docker images for all services..."
|
||||||
|
echo ""
|
||||||
|
|
||||||
|
for SERVICE in $SERVICES; do
|
||||||
|
TOTAL=$((TOTAL + 1))
|
||||||
|
# Construct expected image name
|
||||||
|
IMAGE_NAME="knel-aimiddleware-$SERVICE"
|
||||||
|
|
||||||
|
# Check if image exists
|
||||||
|
if docker images --format '{{.Repository}}' | grep -q "^${IMAGE_NAME}$"; then
|
||||||
|
echo -e "${GREEN}✓${NC} $SERVICE (image exists)"
|
||||||
|
BUILT=$((BUILT + 1))
|
||||||
|
else
|
||||||
|
echo -e "${RED}✗${NC} $SERVICE (not built)"
|
||||||
|
NOT_BUILT=$((NOT_BUILT + 1))
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
echo ""
|
||||||
|
echo -e "${BLUE}=== Summary ===${NC}"
|
||||||
|
echo -e "Total services: $TOTAL"
|
||||||
|
echo -e "${GREEN}Built: $BUILT${NC}"
|
||||||
|
echo -e "${RED}Not built: $NOT_BUILT${NC}"
|
||||||
|
echo ""
|
||||||
|
|
||||||
|
# Show STATUS.md
|
||||||
|
if [ -f "STATUS.md" ]; then
|
||||||
|
echo -e "${BLUE}=== STATUS.md Summary ===${NC}"
|
||||||
|
grep -c "Built" STATUS.md | xargs -I {} echo -e "${GREEN}Built: {}${NC}"
|
||||||
|
grep -c "Pending" STATUS.md | xargs -I {} echo -e "${YELLOW}Pending: {}${NC}"
|
||||||
|
echo ""
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "Next steps:"
|
||||||
|
echo " - To build missing services: docker compose build <service-name>"
|
||||||
|
echo " - To build all services: ./BuildAll.sh"
|
||||||
|
echo " - To view detailed status: cat STATUS.md"
|
||||||
Reference in New Issue
Block a user