-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpublish-server-linux.ps1
More file actions
23 lines (19 loc) · 1.03 KB
/
Copy pathpublish-server-linux.ps1
File metadata and controls
23 lines (19 loc) · 1.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# Cross-publishes the OpsCommandCenter Server as a single self-contained linux-x64 executable.
# Run from Windows - .NET's cross-publish does not need Docker or WSL.
# Copy the "publish-linux" folder plus deploy\ubuntu\* to the Ubuntu VM and run install.sh there.
$ErrorActionPreference = 'Stop'
Set-Location $PSScriptRoot
dotnet publish "src\OpsCommandCenter.Server\OpsCommandCenter.Server.csproj" `
-c Release `
-r linux-x64 `
--self-contained true `
-p:PublishSingleFile=true `
-o "publish-linux"
if ($LASTEXITCODE -ne 0) { throw "Publish failed." }
Remove-Item "publish-linux\OpsCommandCenter.Server.pdb" -ErrorAction SilentlyContinue
$exe = Get-Item "publish-linux\OpsCommandCenter.Server"
Write-Output ("Done: {0} ({1:N1} MB)" -f $exe.FullName, ($exe.Length / 1MB))
Write-Output ""
Write-Output "Next steps (see docs\server-deployment-ubuntu.md for the full walkthrough):"
Write-Output ' scp -r publish-linux deploy\ubuntu\* user@<vm-ip>:/tmp/opscc-deploy/'
Write-Output ' ssh user@<vm-ip> "sudo /tmp/opscc-deploy/install.sh"'