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