-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdeploy_setup.sh
More file actions
65 lines (55 loc) · 1.86 KB
/
deploy_setup.sh
File metadata and controls
65 lines (55 loc) · 1.86 KB
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
63
64
65
#!/bin/bash
# Quick Deployment Setup Script
echo "🚀 Setting up Eye Tracking App for Streamlit Cloud Deployment"
echo "============================================================="
# Check if git is initialized
if [ ! -d ".git" ]; then
echo "❌ Git repository not found. Please run this from your repository root."
exit 1
fi
# Create optimized files for deployment
echo "📝 Creating deployment files..."
# Verify required files exist
required_files=("streamlit_app.py" "requirements_streamlit.txt" "packages.txt" ".streamlit/config.toml")
missing_files=()
for file in "${required_files[@]}"; do
if [ ! -f "$file" ]; then
missing_files+=("$file")
fi
done
if [ ${#missing_files[@]} -ne 0 ]; then
echo "❌ Missing required files:"
printf ' - %s\n' "${missing_files[@]}"
echo ""
echo "Please run the deployment optimization first."
exit 1
fi
echo "✅ All deployment files present"
# Check git status
if [[ `git status --porcelain` ]]; then
echo "📝 Staging changes for commit..."
git add .
git commit -m "Optimize for Streamlit Cloud deployment - fix dependency issues"
echo "✅ Changes committed"
else
echo "✅ No changes to commit"
fi
# Push to GitHub
echo "🚀 Pushing to GitHub..."
git push origin main
echo ""
echo "🎉 Repository is ready for Streamlit Cloud deployment!"
echo ""
echo "Next steps:"
echo "1. Go to https://share.streamlit.io"
echo "2. Create NEW app (don't reuse existing)"
echo "3. Repository: $(git config --get remote.origin.url | sed 's/.*github.com[:/]\([^.]*\).*/\1/')"
echo "4. Branch: main"
echo "5. Main file: streamlit_app.py"
echo ""
echo "📋 Deployment Configuration:"
echo " - Python version: 3.10"
echo " - Requirements file: requirements_streamlit.txt"
echo " - System packages: packages.txt"
echo ""
echo "🐞 If deployment fails, see DEPLOYMENT_FIX.md for troubleshooting"