-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpublish-agent-linux.ps1
More file actions
26 lines (22 loc) · 1.17 KB
/
Copy pathpublish-agent-linux.ps1
File metadata and controls
26 lines (22 loc) · 1.17 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
# Publishes the OpsCommandCenter Linux Agent as a single self-contained portable executable.
# Cross-published from Windows - no Docker/WSL needed.
# The exe IS the installer - copy it to the Linux box and run (as root):
# sudo ./OpsCommandCenterAgentLinux --install --server=http://<server-ip>:5252 --interval=10
$ErrorActionPreference = 'Stop'
Set-Location $PSScriptRoot
dotnet publish "src\OpsCommandCenter.Agent.Linux\OpsCommandCenter.Agent.Linux.csproj" `
-c Release `
-r linux-x64 `
--self-contained true `
-p:PublishSingleFile=true `
-o "publish-agent-linux"
if ($LASTEXITCODE -ne 0) { throw "Publish failed." }
Remove-Item "publish-agent-linux\OpsCommandCenter.Shared.pdb" -ErrorAction SilentlyContinue
$exe = Get-Item "publish-agent-linux\OpsCommandCenterAgentLinux"
Write-Output ("Done: {0} ({1:N1} MB)" -f $exe.FullName, ($exe.Length / 1MB))
Write-Output ""
Write-Output "Silent install command (run as root on the target Linux PC):"
Write-Output ' sudo ./OpsCommandCenterAgentLinux --install --server=http://<server-ip>:5252 --interval=10'
Write-Output ""
Write-Output "Silent uninstall command:"
Write-Output ' sudo ./OpsCommandCenterAgentLinux --uninstall'