Docs: Update README with Proxmox deployment guide and add deployment scripts

This commit is contained in:
2025-12-23 19:08:52 +11:00
parent eceb3aafc5
commit 68c9a67dbd
5 changed files with 516 additions and 17 deletions

53
deploy-remote.ps1 Normal file
View File

@@ -0,0 +1,53 @@
<#
.SYNOPSIS
Automated Update Script for Vendor Inventory (Remote)
.DESCRIPTION
Reads configuration from deploy-config.json.
Connects to the remote server, pulls the latest code, installs dependencies, and restarts the service.
#>
$ErrorActionPreference = "Stop"
$ConfigPath = Join-Path $PSScriptRoot "deploy-config.json"
if (-not (Test-Path $ConfigPath)) {
Write-Error "Configuration file not found: $ConfigPath"
exit 1
}
$Config = Get-Content $ConfigPath | ConvertFrom-Json
$HostName = $Config.host
$User = $Config.username
$Password = $Config.password
$RemotePath = $Config.remotePath
Write-Host "Connecting to $User@$HostName for update..." -ForegroundColor Cyan
# Check for plink
if (-not (Get-Command "plink" -ErrorAction SilentlyContinue)) {
Write-Error "Plink (PuTTY Link) is required but not found. Please install PuTTY."
exit 1
}
# Commands to run on remote
$RemoteCommands = "
echo '📂 Navigating to $RemotePath...'
cd $RemotePath
echo '⬇️ Pulling latest changes...'
git pull
echo '📦 Installing dependencies...'
npm install
echo '🚀 Restarting Service...'
systemctl restart connect5
echo '✅ Status Check:'
systemctl status connect5 --no-pager
"
# Execute
$RemoteCommands = $RemoteCommands -replace "`r`n", "`n"
echo y | plink -ssh -P 22 -t -pw $Password "$User@$HostName" $RemoteCommands
Write-Host "`nUpdate Sequence Completed." -ForegroundColor Green