-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsetup.ps1
More file actions
47 lines (38 loc) · 1.41 KB
/
setup.ps1
File metadata and controls
47 lines (38 loc) · 1.41 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
# NetBox Setup Script for Windows
# Creates virtual environment and installs dependencies
$ErrorActionPreference = 'Stop'
Write-Host "=== NetBox Setup ===" -ForegroundColor Cyan
Write-Host ""
# Check if Python is available
try {
$pythonVersion = python --version 2>&1
Write-Host "Python version: $pythonVersion" -ForegroundColor Green
Write-Host ""
} catch {
Write-Host "ERROR: Python not found" -ForegroundColor Red
Write-Host "Please install Python 3.8 or higher from https://www.python.org/" -ForegroundColor Yellow
exit 1
}
# Remove old venv if exists
if (Test-Path ".venv") {
Write-Host "Removing old virtual environment..." -ForegroundColor Yellow
Remove-Item -Recurse -Force .venv
}
# Create virtual environment
Write-Host "Creating virtual environment..." -ForegroundColor Yellow
python -m venv .venv
# Activate virtual environment
Write-Host "Activating virtual environment..." -ForegroundColor Yellow
& ".venv\Scripts\Activate.ps1"
# Upgrade pip
Write-Host "Upgrading pip..." -ForegroundColor Yellow
python -m pip install --upgrade pip
# Install dependencies
Write-Host "Installing dependencies from requirements.txt..." -ForegroundColor Yellow
pip install -r requirements.txt
Write-Host ""
Write-Host "=== Setup Complete ===" -ForegroundColor Cyan
Write-Host ""
Write-Host "To start the server:" -ForegroundColor Yellow
Write-Host " .\start_server.ps1" -ForegroundColor Gray
Write-Host ""