vibetunnel/web/scripts/test-npm-docker.sh
Peter Steinberger 84b7467e83 fix: handle authenticate-pam as optional dependency in npm package
- Modified postinstall script to extract authenticate-pam prebuilds when npm skips optional deps
- Updated authenticate-pam-loader to load from optional-modules directory
- Prepared beta.12 release with all fixes consolidated
- Moved Docker test script to scripts folder
- Updated documentation in npm.md
2025-07-17 09:32:42 +02:00

60 lines
No EOL
1.7 KiB
Bash
Executable file

#!/bin/bash
# Test VibeTunnel npm package installation in Docker
# Usage: ./scripts/test-npm-docker.sh [version]
# Example: ./scripts/test-npm-docker.sh 1.0.0-beta.11.4
VERSION=${1:-latest}
echo "Testing VibeTunnel npm package version: $VERSION"
echo "================================================"
# Create temporary dockerfile
TEMP_DIR=$(mktemp -d)
DOCKERFILE="$TEMP_DIR/Dockerfile"
cat > "$DOCKERFILE" << EOF
FROM node:20-slim
# Test 1: Install without PAM headers (should succeed)
RUN echo "=== Test 1: Installing without PAM headers ===" && \
npm install -g vibetunnel@$VERSION && \
vibetunnel --version && \
node -e "try { require('authenticate-pam'); console.log('PAM available'); } catch { console.log('PAM not available - this is expected'); }"
# Test 2: Install PAM headers and check if module compiles
RUN echo "=== Test 2: Installing PAM headers ===" && \
apt-get update && apt-get install -y libpam0g-dev && \
echo "PAM headers installed"
# Test 3: Verify VibeTunnel still works
RUN echo "=== Test 3: Verifying VibeTunnel functionality ===" && \
vibetunnel --version && \
vibetunnel --help > /dev/null && \
echo "VibeTunnel is working correctly!"
CMD ["echo", "All tests passed successfully!"]
EOF
# Build and run the test
echo "Building Docker image..."
docker build -f "$DOCKERFILE" -t vibetunnel-npm-test . || {
echo "❌ Docker build failed!"
rm -rf "$TEMP_DIR"
exit 1
}
echo ""
echo "Running tests..."
docker run --rm vibetunnel-npm-test || {
echo "❌ Tests failed!"
rm -rf "$TEMP_DIR"
exit 1
}
# Cleanup
rm -rf "$TEMP_DIR"
docker rmi vibetunnel-npm-test > /dev/null 2>&1
echo ""
echo "✅ All tests passed! VibeTunnel $VERSION installs correctly on Linux."