-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.ps1
More file actions
73 lines (64 loc) · 2.7 KB
/
Copy pathsetup.ps1
File metadata and controls
73 lines (64 loc) · 2.7 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
# ProdHelp Setup Script for Windows PowerShell
# Run: .\setup.ps1
Write-Host "Setting up ProdHelp MCP Server..." -ForegroundColor Cyan
# Check if Python is installed
$pythonVersion = python --version 2>&1
if ($LASTEXITCODE -ne 0) {
Write-Host "Error: Python is not installed or not in PATH" -ForegroundColor Red
Write-Host "Please install Python 3.10+ from https://python.org" -ForegroundColor Yellow
exit 1
}
Write-Host "Found $pythonVersion" -ForegroundColor Green
# Create virtual environment
$venvPath = ".venv"
if (Test-Path $venvPath) {
Write-Host "Virtual environment already exists at $venvPath" -ForegroundColor Yellow
$response = Read-Host "Do you want to recreate it? (y/N)"
if ($response -eq 'y' -or $response -eq 'Y') {
Write-Host "Removing existing virtual environment..." -ForegroundColor Yellow
Remove-Item -Recurse -Force $venvPath
}
else {
Write-Host "Using existing virtual environment" -ForegroundColor Green
}
}
if (-not (Test-Path $venvPath)) {
Write-Host "Creating virtual environment..." -ForegroundColor Cyan
python -m venv $venvPath
if ($LASTEXITCODE -ne 0) {
Write-Host "Error: Failed to create virtual environment" -ForegroundColor Red
exit 1
}
Write-Host "Virtual environment created at $venvPath" -ForegroundColor Green
}
# Activate virtual environment
Write-Host "Activating virtual environment..." -ForegroundColor Cyan
& "$venvPath\Scripts\Activate.ps1"
# Upgrade pip
Write-Host "Upgrading pip..." -ForegroundColor Cyan
python -m pip install --upgrade pip
# Install the package in editable mode
Write-Host "Installing prodhelp and dependencies..." -ForegroundColor Cyan
pip install -e ".[dev]"
if ($LASTEXITCODE -ne 0) {
Write-Host "Error: Failed to install dependencies" -ForegroundColor Red
exit 1
}
Write-Host ""
Write-Host "========================================" -ForegroundColor Green
Write-Host "Setup complete!" -ForegroundColor Green
Write-Host "========================================" -ForegroundColor Green
Write-Host ""
Write-Host "To activate the virtual environment, run:" -ForegroundColor Cyan
Write-Host " .\.venv\Scripts\Activate.ps1" -ForegroundColor White
Write-Host ""
Write-Host "To run the MCP server:" -ForegroundColor Cyan
Write-Host " python -m src.server" -ForegroundColor White
Write-Host ""
Write-Host "To run tests:" -ForegroundColor Cyan
Write-Host " pytest" -ForegroundColor White
Write-Host ""
Write-Host "Don't forget to set environment variables:" -ForegroundColor Yellow
Write-Host " NEW_RELIC_API_KEY, NEW_RELIC_ACCOUNT_ID" -ForegroundColor White
Write-Host " SPLUNK_HOST, SPLUNK_TOKEN" -ForegroundColor White
Write-Host " KUBECONFIG (optional)" -ForegroundColor White