#!/usr/bin/env bash
# Ship this project (with staged prebuilts) from Zo to the build box.
# Usage: tools/push.sh user@host [remote-dir]   (default ~/vanta-kit)
set -euo pipefail
P=$(cd "$(dirname "$0")/.." && pwd)
DEST=${1:?usage: push.sh user@host [remote-dir]}
RDIR=${2:-vanta-kit}
"$P/tools/stage.sh"
rsync -az --delete --exclude .git --exclude /out --exclude /build "$P/" "$DEST:$RDIR/"
echo "push: ok -> $DEST:$RDIR"
echo "next, on the box: $RDIR/tools/host-bootstrap.sh && $RDIR/tools/preflight.sh && $RDIR/tools/sync.sh && $RDIR/tools/apply.sh && $RDIR/tools/build.sh"
