6 Commits

Author SHA1 Message Date
d26aec08e9 Update README.md 2026-10-03 10:48:08 +02:00
36b44a5e94 Update install.sh 2026-10-03 10:01:04 +02:00
1f0e59cb08 Update install.ps1 2026-10-03 10:01:04 +02:00
f5a4f37ed5 Update README.md 2026-10-01 13:10:35 +02:00
47d58f535e Add install.sh 2026-10-01 13:10:35 +02:00
e73673605e Add install.ps1 2026-10-01 13:10:35 +02:00
3 changed files with 94 additions and 2 deletions

View File

@@ -1,3 +1,21 @@
# releases # Agent Hub
Agent Hub's releases. Each build's install lines and files appear here once it is published. Install Agent Hub with one line, no login. Running it again updates Agent Hub.
**Windows**, in PowerShell:
```powershell
irm https://git.bengles.se/agent-hub/releases/raw/branch/main/install.ps1 | iex
```
**Linux** (x86_64), in a terminal:
```sh
curl -fsSL https://git.bengles.se/agent-hub/releases/raw/branch/main/install.sh | sh
```
Or download the newest setup file and run it: [agent-hub-setup.exe](https://git.bengles.se/agent-hub/releases/releases/download/latest/agent-hub-setup.exe) (Windows) or [agent-hub-setup-linux](https://git.bengles.se/agent-hub/releases/releases/download/latest/agent-hub-setup-linux) (Linux).
Every build is a release here, the newest 3 of them; the `latest` release holds the newest build's files.
**License:** free to use, no warranty; all rights reserved. Third-party notices ship with every release.

42
install.ps1 Normal file
View File

@@ -0,0 +1,42 @@
# Agent Hub's install: installs the newest Agent Hub for this user and opens it; running it again updates (HUB-10).
# Its line: irm https://git.bengles.se/agent-hub/releases/raw/branch/main/install.ps1 | iex
# AGENT_HUB_SETUP_ARGS, when set, is added to the setup's arguments, e.g. --no-start.
& {
$ErrorActionPreference = 'Stop'
$ProgressPreference = 'SilentlyContinue'
$v = $PSVersionTable.PSVersion
if ($v.Major -lt 5 -or ($v.Major -eq 5 -and $v.Minor -lt 1) -or ($PSVersionTable.PSEdition -eq 'Core' -and -not $IsWindows)) {
Write-Host 'This line installs Agent Hub on Windows, from PowerShell 5.1 or later. On Linux, run the curl line instead.' -ForegroundColor Red
return
}
if ($PSVersionTable.PSEdition -ne 'Core') {
[Net.ServicePointManager]::SecurityProtocol = [Net.ServicePointManager]::SecurityProtocol -bor [Net.SecurityProtocolType]::Tls12
}
$exe = Join-Path $env:TEMP 'agent-hub-setup.exe'
Write-Host 'Downloading Agent Hub...'
try {
Invoke-WebRequest -Uri 'https://git.bengles.se/agent-hub/releases/releases/download/latest/agent-hub-setup.exe' -OutFile $exe -UseBasicParsing
} catch {
$failure = $_
$status = 0
try { $status = [int]$failure.Exception.Response.StatusCode } catch {}
if ($status -eq 0) {
try { Invoke-WebRequest -Uri 'https://git.bengles.se/agent-hub/releases/releases/download/latest/agent-hub-setup.exe' -Method Head -UseBasicParsing | Out-Null }
catch { try { $status = [int]$_.Exception.Response.StatusCode } catch {} }
}
if ($status -eq 404) { Write-Host 'Can''t download Agent Hub from git.bengles.se/agent-hub/releases: it has no release yet. Try again in a minute.' -ForegroundColor Red }
else { Write-Host ('Can''t download Agent Hub from git.bengles.se/agent-hub/releases: ' + $failure.Exception.Message + ' ' + 'Try again in a minute.') -ForegroundColor Red }
return
}
$saved = @{}
$extra = @("$env:AGENT_HUB_SETUP_ARGS" -split '\s+' | Where-Object { $_ })
Write-Host 'Installing Agent Hub...'
try {
& $exe @extra
$code = $LASTEXITCODE
} finally {
foreach ($name in $saved.Keys) { [Environment]::SetEnvironmentVariable($name, $saved[$name]) }
}
Remove-Item $exe -ErrorAction SilentlyContinue
if ($code -ne 0) { Write-Host 'Agent Hub''s setup stopped: see above.' -ForegroundColor Red }
}

32
install.sh Normal file
View File

@@ -0,0 +1,32 @@
#!/bin/sh
# Agent Hub's install: installs the newest Agent Hub for this user and opens it; running it again updates (HUB-10).
# Its line: curl -fsSL https://git.bengles.se/agent-hub/releases/raw/branch/main/install.sh | sh
# AGENT_HUB_SETUP_ARGS, when set, is added to the setup's arguments, e.g. --no-start.
agent_hub_install() {
if [ "$(uname -s)" != Linux ] || [ "$(uname -m)" != x86_64 ]; then
echo 'This line installs Agent Hub on Linux (x86_64). On Windows, run the PowerShell line instead.' >&2
return 1
fi
glibc=$(getconf GNU_LIBC_VERSION 2>/dev/null) || glibc=
case "${glibc#glibc }" in
2.[0-9]|2.[12][0-9]|2.3[0-4]) echo "Agent Hub needs glibc 2.35 or newer; this system has ${glibc#glibc }." >&2; return 1 ;;
esac
command -v curl >/dev/null 2>&1 || { echo 'Installing Agent Hub needs curl.' >&2; return 1; }
dir=$(mktemp -d) || return 1
exe="$dir/agent-hub-setup-linux"
echo 'Downloading Agent Hub...'
status=$(curl -sSL -o "$exe" -w '%{http_code}' 'https://git.bengles.se/agent-hub/releases/releases/download/latest/agent-hub-setup-linux') || status=${status:-000}
case "$status" in
200) ;;
404) echo 'Can'\''t download Agent Hub from git.bengles.se/agent-hub/releases: it has no release yet. Try again in a minute.' >&2; rm -rf "$dir"; return 1 ;;
*) echo 'Can'\''t download Agent Hub from git.bengles.se/agent-hub/releases'" (HTTP $status). "'Try again in a minute.' >&2; rm -rf "$dir"; return 1 ;;
esac
chmod +x "$exe"
echo 'Installing Agent Hub...'
"$exe" ${AGENT_HUB_SETUP_ARGS:-} </dev/null
code=$?
rm -rf "$dir"
[ "$code" -eq 0 ] || echo "Agent Hub's setup stopped: see above." >&2
return "$code"
}
agent_hub_install