Fix deploy.ps1 to use OpenSSH instead of PuTTY tools for passwordless access
This commit is contained in:
@@ -102,7 +102,7 @@ foreach ($file in $filesToDeploy) {
|
||||
$remoteTempPath = "/tmp/deploy_$(Split-Path $file -Leaf)"
|
||||
|
||||
Write-Host " Copying $file..." -ForegroundColor Gray
|
||||
pscp $localPath "${RMM_HOST}:${remoteTempPath}" 2>&1 | Out-Null
|
||||
scp "$localPath" "${RMM_HOST}:${remoteTempPath}" 2>&1 | Out-Null
|
||||
|
||||
if ($LASTEXITCODE -ne 0) {
|
||||
Write-Host "[ERROR] Failed to copy $file" -ForegroundColor Red
|
||||
@@ -129,7 +129,7 @@ foreach ($file in $filesToDeploy) {
|
||||
|
||||
$fullCommand = ($deployCommands -join " && ") + " && echo 'Files deployed'"
|
||||
|
||||
plink $RMM_HOST $fullCommand
|
||||
ssh $RMM_HOST $fullCommand
|
||||
if ($LASTEXITCODE -ne 0) {
|
||||
Write-Host "[ERROR] Failed to move files to production" -ForegroundColor Red
|
||||
exit 1
|
||||
@@ -139,7 +139,7 @@ Write-Host ""
|
||||
|
||||
# Step 7: Restart API service
|
||||
Write-Host "[7/9] Restarting API service..." -ForegroundColor Yellow
|
||||
plink $RMM_HOST "systemctl restart claudetools-api && sleep 3 && echo 'Service restarted'"
|
||||
ssh $RMM_HOST "systemctl restart claudetools-api && sleep 3 && echo 'Service restarted'"
|
||||
if ($LASTEXITCODE -ne 0) {
|
||||
Write-Host "[ERROR] Failed to restart service" -ForegroundColor Red
|
||||
exit 1
|
||||
|
||||
Reference in New Issue
Block a user