old-server.sh 994 B

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