feat: add OS compatibility checks before running platform-specific logic

- lib/common.sh: add require_local_os, require_remote_os, require_remote_pkg_manager
- setup/macbook.sh: require macOS (Darwin)
- setup/unraid.sh: require remote is Linux
- setup/fedora.sh: require remote is Linux + has dnf (RPM-based)
- manage_runner.sh: native runner add/remove requires macOS
- run_all.sh: control plane must be macOS
- preflight.sh: 3 new checks (1: local=macOS, 2: Unraid=Linux, 3: Fedora=Linux+dnf)
- phase5_migrate_pipelines.sh: fix sed -i to be portable (no macOS-only syntax)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
S
2026-02-26 19:00:13 -06:00
parent 40fe847755
commit 720197bb10
8 changed files with 164 additions and 38 deletions

View File

@@ -13,6 +13,15 @@ require_vars FEDORA_IP FEDORA_SSH_USER FEDORA_GITEA_DATA_PATH
log_info "=== Fedora Setup ==="
# --------------------------------------------------------------------------
# OS check — must be Linux with dnf (RPM-based distro like Fedora/RHEL/CentOS)
# This script uses `dnf` for all package installs. Running it against a
# Debian/Ubuntu/Arch host would fail with confusing errors.
# --------------------------------------------------------------------------
log_info "Verifying Fedora OS..."
require_remote_os "FEDORA" "Linux" "Fedora target must be a Linux machine — check FEDORA_IP in .env"
require_remote_pkg_manager "FEDORA" "dnf" "Fedora target must have dnf (RPM-based distro) — this script won't work on Debian/Ubuntu"
# --------------------------------------------------------------------------
# SSH connectivity
# --------------------------------------------------------------------------

View File

@@ -10,6 +10,11 @@ source "${SCRIPT_DIR}/../lib/common.sh"
log_info "=== MacBook Setup ==="
# --------------------------------------------------------------------------
# OS check — this script uses Homebrew, launchctl, Xcode tools (macOS only)
# --------------------------------------------------------------------------
require_local_os "Darwin" "macbook.sh must run on macOS — detected a non-macOS system"
# --------------------------------------------------------------------------
# Homebrew
# --------------------------------------------------------------------------

View File

@@ -13,6 +13,12 @@ require_vars UNRAID_IP UNRAID_SSH_USER UNRAID_GITEA_DATA_PATH
log_info "=== Unraid Setup ==="
# --------------------------------------------------------------------------
# OS check — Unraid must be Linux (Docker, static binaries, x86_64)
# --------------------------------------------------------------------------
log_info "Verifying Unraid OS..."
require_remote_os "UNRAID" "Linux" "Unraid must be a Linux machine — check UNRAID_IP in .env"
# --------------------------------------------------------------------------
# SSH connectivity
# --------------------------------------------------------------------------