youtube-automation/start.sh

39 lines
992 B
Bash
Executable File

#!/bin/bash
# YouTube-Directus Automation Service Startup Script
echo "🚀 Starting YouTube-Directus Automation Service..."
# Check if virtual environment exists
if [ ! -d "venv" ]; then
echo "📦 Creating virtual environment..."
python3 -m venv venv
fi
# Activate virtual environment
echo "🔄 Activating virtual environment..."
source venv/bin/activate
# Install/update requirements
echo "📋 Installing requirements..."
pip install -r requirements.txt
# Load environment variables
if [ -f ".env" ]; then
echo "⚙️ Loading environment variables..."
set -a
source .env
set +a
else
echo "⚠️ No .env file found - using defaults"
fi
# Start the FastAPI service
echo "🌐 Starting FastAPI service on port ${PORT:-8000}..."
echo "📍 Health check: http://localhost:${PORT:-8000}/health"
echo "🔗 Webhook endpoint: http://localhost:${PORT:-8000}/webhook/directus"
echo ""
echo "Press Ctrl+C to stop the service"
echo ""
cd src && python main.py