Downloading the .NET agent
Download the SeaLights .NET Agent as a self-contained package or from NuGet.
Last updated
Was this helpful?
Was this helpful?
$SL_PACKAGE = "Sealights.DotNet.Windows"
$NUGET_URL = "https://www.nuget.org/api/v2/package"
$SL_VERSION = "3.13.0"
$packageName = "sealights-dotnet-windows-$SL_VERSION.nupkg"
$extractPath = "./sealights-dotnet-windows-$SL_VERSION"
Invoke-WebRequest -Uri "$NUGET_URL/$SL_PACKAGE/$SL_VERSION" -OutFile $packageName -UseBasicParsing
Expand-Archive -Path $packageName -DestinationPath $extractPath -Force
New-Item -ItemType SymbolicLink -Path "./sl-dotnet-agent" -Target "$extractPath/content" -Force | Out-Null
Write-Output "[Sealights] Installed version is: $(Get-Content ./sl-dotnet-agent/version.txt)"SL_PACKAGE="Sealights.DotNet.Linux"
NUGET_URL="https://www.nuget.org/api/v2/package"
SL_VERSION="3.13.0"
wget -nv -O sealights-dotnet-linux-$SL_VERSION.nupkg "$NUGET_URL/$SL_PACKAGE/$SL_VERSION"
unzip -oq sealights-dotnet-linux-$SL_VERSION.nupkg -d "./sealights-dotnet-linux-$SL_VERSION"
ln -s ./sealights-dotnet-linux-$SL_VERSION/content ./sl-dotnet-agent
echo "[Sealights] Installed version is: $(cat ./sl-dotnet-agent/version.txt)"$global:ProgressPreference = "SilentlyContinue"
iwr -OutFile sealights-dotnet-agent.zip -UseBasicParsing -Uri https://agents.sealights.co/dotnetcore/latest/sealights-dotnet-agent-windows-self-contained.zip
Expand-Archive .\sealights-dotnet-agent.zip -DestinationPath sl-dotnet-agent -Force
Write-Output "[Sealights] .NET Agent version is: $(Get-Content .\sl-dotnet-agent\version.txt)"wget -nv -O sealights-dotnet-agent-linux.tar.gz https://agents.sealights.co/dotnetcore/latest/sealights-dotnet-agent-linux-self-contained.tar.gz
mkdir sl-dotnet-agent && tar -xzf ./sealights-dotnet-agent-linux.tar.gz --directory ./sl-dotnet-agent
echo "[Sealights] .NET Agent version is: $(cat ./sl-dotnet-agent/version.txt)"wget -nv -O sealights-dotnet-agent-alpine.tar.gz https://agents.sealights.co/dotnetcore/latest/sealights-dotnet-agent-alpine-self-contained.tar.gz
mkdir sl-dotnet-agent && tar -xzf ./sealights-dotnet-agent-alpine.tar.gz --directory ./sl-dotnet-agent
echo "[Sealights] .NET Agent version is: $(cat ./sl-dotnet-agent/version.txt)"steps:
- pwsh: |
$ProgressPreference = "SilentlyContinue"
Invoke-WebRequest `
-Uri "https://agents.sealights.co/dotnetcore/latest/sealights-dotnet-agent-windows-self-contained.zip" `
-OutFile "sealights-dotnet-agent.zip" `
-UseBasicParsing
Expand-Archive ".\sealights-dotnet-agent.zip" -DestinationPath ".\sl-dotnet-agent" -Force
Write-Host "[Sealights] Installed version: $(Get-Content .\sl-dotnet-agent\version.txt)"
displayName: Download SeaLights .NET Agentjobs:
tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Download SeaLights .NET Agent
shell: bash
run: |
wget -nv -O sealights-dotnet-agent-linux.tar.gz https://agents.sealights.co/dotnetcore/latest/sealights-dotnet-agent-linux-self-contained.tar.gz
mkdir -p sl-dotnet-agent
tar -xzf ./sealights-dotnet-agent-linux.tar.gz --directory ./sl-dotnet-agent
echo "[Sealights] Installed version: $(cat ./sl-dotnet-agent/version.txt)"$SEALIGHTS_URL = "mydomain.sealights.co"
$headers = @{
accept = "application/json"
Authorization = "Bearer $env:SEALIGHTS_AGENT_TOKEN"
}
$version = (Invoke-RestMethod "https://$SEALIGHTS_URL/api/v2/agents/dotnet/recommended" -Headers $headers).agent.version
Write-Output "[Sealights] Selected .NET version in Dashboard settings is: $version"SEALIGHTS_URL="mydomain.sealights.co"
SL_VERSION=$(curl -s -X GET "https://$SEALIGHTS_URL/api/v2/agents/dotnet/recommended" -H "accept: application/json" -H "Authorization: Bearer $SEALIGHTS_AGENT_TOKEN" -L | jq -r .agent.version)
echo "[Sealights] Selected .NET version in Dashboard settings is: $SL_VERSION"