smoke-install.sh 916 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. #!/usr/bin/env bash
  2. # Build, pack, and smoke-test qmd in a container with mise + node + bun.
  3. # Works with docker or podman (whichever is available).
  4. set -euo pipefail
  5. cd "$(dirname "$0")/.."
  6. # Pick container runtime
  7. if command -v podman &>/dev/null; then
  8. CTR=podman
  9. elif command -v docker &>/dev/null; then
  10. CTR=docker
  11. else
  12. echo "Error: neither podman nor docker found" >&2
  13. exit 1
  14. fi
  15. echo "Using: $CTR"
  16. # Build TypeScript
  17. echo "==> Building TypeScript..."
  18. npm run build --silent
  19. # Pack tarball into test/ (the build context)
  20. echo "==> Packing tarball..."
  21. rm -f test/tobilu-qmd-*.tgz
  22. TARBALL=$(npm pack --pack-destination test/ 2>/dev/null | tail -1)
  23. echo " $TARBALL"
  24. # Build container image
  25. echo "==> Building container..."
  26. $CTR build -f test/Containerfile -t qmd-smoke test/
  27. # Run smoke tests
  28. echo "==> Running smoke tests..."
  29. $CTR run --rm qmd-smoke
  30. # Clean up tarball
  31. rm -f test/tobilu-qmd-*.tgz