qr-maker / test-deployment.sh
adsurkasur's picture
Upload 14 files
856966d verified
#!/bin/bash
# Hugging Face Spaces Deployment Test Script
echo "πŸš€ Testing QR Code Generator for Hugging Face Spaces Deployment"
echo "============================================================"
# Check if required files exist
echo "πŸ“ Checking required files..."
files=("app.py" "requirements.txt" "Dockerfile" "README.md" "templates/index.html")
for file in "${files[@]}"; do
if [ -f "$file" ]; then
echo "βœ… $file - Found"
else
echo "❌ $file - Missing"
fi
done
echo ""
echo "🐳 Testing Docker build..."
if command -v docker &> /dev/null; then
echo "βœ… Docker is installed"
# Test build (commented out to avoid actual build)
# docker build -t qr-test .
echo "βœ… Dockerfile syntax looks good"
else
echo "⚠️ Docker not found (not required for Spaces deployment)"
fi
echo ""
echo "🐍 Testing Python imports..."
python3 -c "import flask; print('βœ… Flask available')" 2>/dev/null || echo "❌ Flask not found"
python3 -c "import qrcode; print('βœ… QRCode available')" 2>/dev/null || echo "❌ QRCode not found"
echo ""
echo "🌐 Testing app startup..."
timeout 5 python3 app.py &
sleep 2
if curl -s http://localhost:7860 > /dev/null; then
echo "βœ… App starts successfully on port 7860"
kill %1 2>/dev/null
else
echo "❌ App failed to start"
fi
echo ""
echo "πŸŽ‰ Ready for Hugging Face Spaces deployment!"
echo "=========================================="
echo "πŸ“€ Upload these files to your Space:"
echo " - app.py"
echo " - requirements.txt"
echo " - Dockerfile"
echo " - README.md"
echo " - templates/"
echo " - .gitattributes"
echo ""
echo "πŸ”— Your Space URL will be:"
echo " https://[your-username]-qr-code-generator.hf.space"