feat: add version checking and install manifest tracking
Add minimum version validation for all dependencies across local and remote machines (jq>=1.6, curl>=7.70, git>=2.30, docker>=20.0, compose>=2.0, shellcheck>=0.8, gh>=2.0). Setup scripts now record every install action to .manifests/<host>.manifest files, enabling full rollback via setup/cleanup.sh. teardown_all.sh gains --cleanup flag to chain prerequisite removal after phase teardowns. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
42
preflight.sh
42
preflight.sh
@@ -16,7 +16,7 @@ FAIL_COUNT=0
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# Check helper — runs a check function, tracks pass/fail count.
|
||||
# Intentionally does NOT exit on failure — we want to run ALL 19 checks
|
||||
# Intentionally does NOT exit on failure — we want to run ALL checks
|
||||
# so the user sees every issue at once, not one at a time.
|
||||
# ---------------------------------------------------------------------------
|
||||
check() {
|
||||
@@ -293,11 +293,49 @@ if ! check_nginx_conf 2>/dev/null; then
|
||||
log_error " → Nginx config path ${NGINX_CONF_PATH:-} not writable on Unraid."
|
||||
fi
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# Check 20: Local tool minimum versions
|
||||
# Validates that tools on the MacBook meet minimum requirements.
|
||||
# ---------------------------------------------------------------------------
|
||||
check_local_versions() {
|
||||
local fail=0
|
||||
check_min_version "jq" "jq --version" "1.6" || fail=1
|
||||
check_min_version "curl" "curl --version" "7.70" || fail=1
|
||||
check_min_version "git" "git --version" "2.30" || fail=1
|
||||
return $fail
|
||||
}
|
||||
check 20 "Local tool minimum versions (jq>=1.6, curl>=7.70, git>=2.30)" check_local_versions
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# Check 21: Unraid tool minimum versions
|
||||
# ---------------------------------------------------------------------------
|
||||
check_unraid_versions() {
|
||||
local fail=0
|
||||
check_remote_min_version "UNRAID" "docker" "docker --version" "20.0" || fail=1
|
||||
check_remote_min_version "UNRAID" "docker-compose" "docker compose version 2>/dev/null || docker-compose --version" "2.0" || fail=1
|
||||
check_remote_min_version "UNRAID" "jq" "jq --version" "1.6" || fail=1
|
||||
return $fail
|
||||
}
|
||||
check 21 "Unraid tool minimum versions (docker>=20, compose>=2, jq>=1.6)" check_unraid_versions
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# Check 22: Fedora tool minimum versions
|
||||
# ---------------------------------------------------------------------------
|
||||
check_fedora_versions() {
|
||||
local fail=0
|
||||
check_remote_min_version "FEDORA" "docker" "docker --version" "20.0" || fail=1
|
||||
check_remote_min_version "FEDORA" "docker-compose" "docker compose version" "2.0" || fail=1
|
||||
check_remote_min_version "FEDORA" "jq" "jq --version" "1.6" || fail=1
|
||||
return $fail
|
||||
}
|
||||
check 22 "Fedora tool minimum versions (docker>=20, compose>=2, jq>=1.6)" check_fedora_versions
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# Summary
|
||||
# ---------------------------------------------------------------------------
|
||||
TOTAL_CHECKS=$((PASS_COUNT + FAIL_COUNT))
|
||||
printf '\n'
|
||||
log_info "Results: ${PASS_COUNT} passed, ${FAIL_COUNT} failed (out of 19 checks)"
|
||||
log_info "Results: ${PASS_COUNT} passed, ${FAIL_COUNT} failed (out of ${TOTAL_CHECKS} checks)"
|
||||
|
||||
if [[ $FAIL_COUNT -gt 0 ]]; then
|
||||
log_error "Preflight FAILED — fix the issues above before proceeding."
|
||||
|
||||
Reference in New Issue
Block a user