#!/usr/bin/env bash # # packaging/old-server.sh - unpack a RELEASED server binary into # build/old-server-/ so an e2e suite can create data the way that # release did (tests/load_test/test_encryption_at_rest.sh seeds with 2.16.0). # Needs the .deb in a smartbotics-deb-repo checkout ($DEB_REPO_DIR, default: # next to this one). The binary runs in the packaging/dev.sh image (Debian 13). set -euo pipefail SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" ROOT="$(cd "$SCRIPT_DIR/.." && pwd)" V="${1:?usage: packaging/old-server.sh }" DEB_REPO_DIR="${DEB_REPO_DIR:-$(dirname "$ROOT")/smartbotics-deb-repo}" DEB="$DEB_REPO_DIR/repo/pool/trixie/main/smartbotic-database_${V}-1_amd64.deb" [[ -f "$DEB" ]] || { echo "missing $DEB"; exit 1; } OUT="$ROOT/build/old-server-$V" rm -rf "$OUT" mkdir -p "$OUT" cd "$OUT" ar x "$DEB" tar -xf data.tar.* ./usr/bin/smartbotic-database rm -f control.tar.* data.tar.* debian-binary echo "$OUT/usr/bin/smartbotic-database"