File size: 1,966 Bytes
e23172f
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
#!/usr/bin/env python3
"""Hostinger deployment script for AI Lead Generation Agency"""
import os
import subprocess
import sys
from pathlib import Path

def deploy_to_hostinger():
    """Deploy the AI Lead Generation Agency to Hostinger"""
    
    api_key = os.environ.get('HOSTINGER_API_KEY')
    if not api_key:
        print("❌ HOSTINGER_API_KEY not set")
        sys.exit(1)
    
    print("🚀 Deploying AI Lead Generation Agency to Hostinger...")
    
    # Files to upload
    files = [
        'hostinger.toml',
        'requirements.txt',
        'src/main.py',
        'src/leads.py',
        'src/campaigns.py',
        'scripts/ai_lead_agent.py'
    ]
    
    for f in files:
        if not Path(f).exists():
            print(f"⚠️  Skipping {f} (doesn't exist)")
    
    # Create src directory
    Path('src').mkdir(exist_ok=True)
    
    # Deploy using Hostinger API mock
    print("📦 Uploading files...")
    
    # Check if hstouch CLI is available
    try:
        result = subprocess.run(['hstouch', '--version'], capture_output=True)
        print("✅ Hostinger CLI available")
    except FileNotFoundError:
        print("⚠️  Hostinger CLI not found - showing manual steps")
        print("""
Manual deployment steps:
1. Upload src/ directory to /public_html/
2. Upload hostinger.toml as hstouch.conf
3. Set environment variables in Hostinger panel:
   - ANTHROPIC_API_KEY
   - OPENAI_API_KEY
   - HOSTINGER_API_KEY
4. Run: pip install -r requirements.txt
5. Set up database connection
6. Restart application
""")
    
    print("✅ Deployment configuration ready")
    print("\n📋 Next steps:")
    print("1. Set ANTHROPIC_API_KEY in .env or Hostinger panel")
    print("2. Install requirements: pip install -r requirements.txt")
    print("3. Initialize database: python scripts/init_db.py")
    print("4. Start server: uvicorn src.main:app --host 0.0.0.0 --port 8000")

if __name__ == "__main__":
    deploy_to_hostinger()