Spaces:
Runtime error
Runtime error
File size: 1,848 Bytes
0469d65 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 |
#!/bin/bash
# SafetyMaster Pro - Clean CLI Deployment
echo "π‘οΈ SafetyMaster Pro - Clean CLI Deployment"
echo "=========================================="
# Check if Railway CLI is installed
if ! command -v /opt/homebrew/bin/railway &> /dev/null; then
echo "β Railway CLI not found. Installing..."
brew install railway
fi
echo "β
Railway CLI found"
# Check if logged in
if ! /opt/homebrew/bin/railway whoami &> /dev/null; then
echo "π Please login to Railway..."
/opt/homebrew/bin/railway login
fi
echo "β
Authenticated with Railway"
# Show what will be uploaded (excluding large files)
echo "π¦ Files to be uploaded (excluding Mac apps, zips, models):"
echo " Core application files only..."
# Commit any changes
echo "π Committing changes..."
git add .
git commit -m "Clean deployment: $(date)" || echo "No changes to commit"
# Show deployment size estimate
echo "π Deployment size: ~2-3MB (models excluded)"
echo "π€ AI models will download automatically during build"
# Deploy with optimized settings
echo "π Starting clean deployment..."
echo " Excluding: Mac apps, zip files, test files, demos"
echo " Including: Core app, templates, requirements, Dockerfile"
# Use detached mode to avoid timeout
/opt/homebrew/bin/railway up --detach
# Check deployment status
if [ $? -eq 0 ]; then
echo ""
echo "π Deployment Started Successfully!"
echo "=========================="
echo ""
echo "π Monitoring deployment progress..."
echo " This may take 3-5 minutes for model downloads"
echo ""
# Follow logs for a bit
echo "π Live deployment logs (press Ctrl+C to stop watching):"
/opt/homebrew/bin/railway logs --follow
else
echo "β Deployment failed. Checking logs..."
/opt/homebrew/bin/railway logs --tail 50
exit 1
fi |