Files
proxmox/scripts/verify/run-all-validation.sh

48 lines
1.5 KiB
Bash
Raw Permalink Normal View History

#!/usr/bin/env bash
# Run all validation checks that do not require LAN/SSH/credentials.
# Use for CI or pre-deploy: dependencies, config files, optional genesis.
# Usage: bash scripts/verify/run-all-validation.sh [--skip-genesis]
# --skip-genesis: do not run validate-genesis.sh (default: run if smom-dbis-138 present).
set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
PROJECT_ROOT="$(cd "$SCRIPT_DIR/../.." && pwd)"
cd "$PROJECT_ROOT"
SKIP_GENESIS=false
[[ "${1:-}" == "--skip-genesis" ]] && SKIP_GENESIS=true
log_ok() { echo -e "\033[0;32m[✓]\033[0m $1"; }
log_err() { echo -e "\033[0;31m[✗]\033[0m $1"; exit 1; }
echo "=== Run all validation (no LAN/SSH) ==="
echo ""
echo "1. Dependencies..."
bash "$SCRIPT_DIR/check-dependencies.sh" || log_err "check-dependencies failed"
log_ok "Dependencies OK"
echo ""
echo "2. Config files..."
bash "$SCRIPT_DIR/../validation/validate-config-files.sh" || log_err "validate-config-files failed"
log_ok "Config validation OK"
echo ""
if [[ "$SKIP_GENESIS" == true ]]; then
echo "3. Genesis — skipped (--skip-genesis)"
else
echo "3. Genesis (smom-dbis-138)..."
GENESIS_SCRIPT="$PROJECT_ROOT/smom-dbis-138/scripts/validation/validate-genesis.sh"
if [[ -x "$GENESIS_SCRIPT" ]]; then
bash "$GENESIS_SCRIPT" || log_err "validate-genesis failed"
log_ok "Genesis OK"
else
echo " (smom-dbis-138/scripts/validation/validate-genesis.sh not found, skipping)"
fi
fi
echo ""
log_ok "All validation passed."
exit 0