44 lines
1.1 KiB
Bash
Executable File
44 lines
1.1 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
# YouTube to Directus Microsite Startup Script
|
|
|
|
set -e
|
|
|
|
echo "🎬 Starting YouTube to Directus Microsite"
|
|
echo "========================================"
|
|
|
|
# Check if .env file exists
|
|
if [ ! -f ../.env ]; then
|
|
echo "❌ Error: .env file not found in parent directory!"
|
|
echo "💡 Make sure the .env file exists with Directus configuration"
|
|
exit 1
|
|
fi
|
|
|
|
# Check if Python virtual environment exists
|
|
if [ ! -d ../venv ]; then
|
|
echo "📦 Creating Python virtual environment..."
|
|
cd .. && python3 -m venv venv
|
|
cd microsite
|
|
fi
|
|
|
|
# Activate virtual environment
|
|
echo "🔧 Activating virtual environment..."
|
|
source ../venv/bin/activate
|
|
|
|
# Install dependencies
|
|
echo "📥 Installing dependencies..."
|
|
pip install -r ../requirements.txt flask
|
|
|
|
# Check configuration
|
|
echo "⚙️ Checking configuration..."
|
|
cd ..
|
|
python3 -c "import config; print('Configuration loaded successfully')"
|
|
cd microsite
|
|
|
|
# Start the microsite
|
|
echo "🚀 Starting microsite server..."
|
|
echo " - URL: http://localhost:5001"
|
|
echo " - Press Ctrl+C to stop"
|
|
echo ""
|
|
|
|
python3 app.py |