Deployr 0.1.0: cross-platform application deployment CLI

Replaces Ninite for endpoint software: one catalog, one command line, and the
same behaviour on Windows, macOS and Linux. Single static binary, no server and
no agent, driven from an RMM script runner or by hand.

- catalog of ~50 apps compiled into the binary, extendable with YAML overlays
  in catalog.d or via --catalog, no rebuild required
- providers: winget, choco, brew, cask, apt, dnf/yum, zypper, pacman, flatpak,
  snap, plus direct vendor downloads (msi/exe/msu/dmg/pkg/deb/rpm/zip/tar.gz/
  AppImage)
- sources are tried in order and fall through, so one catalog entry covers
  winget on Windows, a cask on macOS and the vendor .deb on Debian
- provider-independent detection (registry, paths, commands) makes runs
  idempotent even for software installed by hand
- unattended by construction: stdin closed, silent flags, per-command timeouts
- handles the traps that break naive wrappers: winget missing under SYSTEM,
  Homebrew refusing root, 1641/3010 reboot exits, "already installed" reported
  as failure
- --json summary on stdout with progress on stderr, and RMM-friendly exit codes
  (0 ok, 1 failed, 2 usage, 3 privileges)

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
ClaudeandClaude Opus 5 committed 2026-08-26 16:55:13 -05:00
commit 4909edee2d
40 files changed
+6714

No files matched your search

+64
View File
@@ -0,0 +1,64 @@
<#
.SYNOPSIS
Cross-compiles deployr for every supported platform.
.EXAMPLE
.\scripts\build.ps1 # build everything into dist\
.\scripts\build.ps1 -Version 1.0.0 # stamp a release version
.\scripts\build.ps1 -Only windows/amd64
#>
[CmdletBinding()]
param(
[string]$Version = "dev",
[string]$Only = "",
[string]$OutDir = "dist"
)
$ErrorActionPreference = "Stop"
$root = Split-Path -Parent $PSScriptRoot
Set-Location $root
$targets = @(
"windows/amd64",
"windows/arm64",
"darwin/amd64",
"darwin/arm64",
"linux/amd64",
"linux/arm64"
)
if ($Only) { $targets = @($Only) }
$commit = "none"
try { $commit = (git rev-parse --short HEAD 2>$null).Trim() } catch { }
if (-not $commit) { $commit = "none" }
$date = (Get-Date).ToUniversalTime().ToString("yyyy-MM-ddTHH:mm:ssZ")
$pkg = "git.starwarslab.us/ATOM_IT/Deployr/internal/version"
$ldflags = "-s -w -X $pkg.Version=$Version -X $pkg.Commit=$commit -X $pkg.Date=$date"
New-Item -ItemType Directory -Force -Path $OutDir | Out-Null
foreach ($target in $targets) {
$parts = $target.Split("/")
$os = $parts[0]
$arch = $parts[1]
$name = "deployr_${Version}_${os}_${arch}"
if ($os -eq "windows") { $name += ".exe" }
Write-Host "building $target -> $OutDir\$name"
$env:GOOS = $os
$env:GOARCH = $arch
$env:CGO_ENABLED = "0"
go build -trimpath -ldflags $ldflags -o "$OutDir\$name" ./cmd/deployr
if ($LASTEXITCODE -ne 0) { throw "build failed for $target" }
}
$env:GOOS = ""; $env:GOARCH = ""; $env:CGO_ENABLED = ""
Get-ChildItem $OutDir -File |
Where-Object { $_.Name -ne "SHA256SUMS" } |
ForEach-Object { "{0} {1}" -f (Get-FileHash $_.FullName -Algorithm SHA256).Hash.ToLower(), $_.Name } |
Set-Content -Path (Join-Path $OutDir "SHA256SUMS") -Encoding utf8
Write-Host ""
Get-ChildItem $OutDir | Format-Table Name, @{N = "MB"; E = { [math]::Round($_.Length / 1MB, 1) } }
+37
View File
@@ -0,0 +1,37 @@
#!/usr/bin/env bash
# Cross-compiles deployr for every supported platform.
#
# ./scripts/build.sh # build everything into dist/
# VERSION=1.0.0 ./scripts/build.sh # stamp a release version
# TARGETS="linux/amd64" ./scripts/build.sh
set -euo pipefail
cd "$(dirname "$0")/.."
VERSION="${VERSION:-dev}"
OUTDIR="${OUTDIR:-dist}"
TARGETS="${TARGETS:-windows/amd64 windows/arm64 darwin/amd64 darwin/arm64 linux/amd64 linux/arm64}"
COMMIT="$(git rev-parse --short HEAD 2>/dev/null || echo none)"
DATE="$(date -u +%Y-%m-%dT%H:%M:%SZ)"
PKG="git.starwarslab.us/ATOM_IT/Deployr/internal/version"
LDFLAGS="-s -w -X ${PKG}.Version=${VERSION} -X ${PKG}.Commit=${COMMIT} -X ${PKG}.Date=${DATE}"
mkdir -p "$OUTDIR"
for target in $TARGETS; do
os="${target%%/*}"
arch="${target##*/}"
name="deployr_${VERSION}_${os}_${arch}"
[ "$os" = "windows" ] && name="${name}.exe"
echo "building ${target} -> ${OUTDIR}/${name}"
CGO_ENABLED=0 GOOS="$os" GOARCH="$arch" \
go build -trimpath -ldflags "$LDFLAGS" -o "${OUTDIR}/${name}" ./cmd/deployr
done
( cd "$OUTDIR" && rm -f SHA256SUMS && sha256sum ./* > SHA256SUMS 2>/dev/null || shasum -a 256 ./* > SHA256SUMS )
echo
ls -lh "$OUTDIR"