Spaces:
Runtime error
Runtime error
# 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 |