| const { execSync } = require('child_process'); |
| const fs = require('fs'); |
| const path = require('path'); |
|
|
| console.log('🚀 Starting Titan Nexus Quantum v10.0 deployment...'); |
|
|
| try { |
| |
| if (!process.env.GEMINI_API_KEY) { |
| console.error('❌ GEMINI_API_KEY is not set in environment variables'); |
| process.exit(1); |
| } |
|
|
| |
| if (!fs.existsSync('./serviceAccountKey.json')) { |
| console.error('❌ serviceAccountKey.json not found'); |
| process.exit(1); |
| } |
|
|
| |
| console.log('📦 Installing dependencies...'); |
| execSync('npm install --production', { stdio: 'inherit' }); |
|
|
| |
| console.log('📁 Creating system directories...'); |
| ['logs', 'backups', 'uploads'].forEach(dir => { |
| if (!fs.existsSync(dir)) { |
| fs.mkdirSync(dir, { recursive: true }); |
| } |
| }); |
|
|
| |
| console.log('🔍 Validating configuration...'); |
| const requiredFiles = ['server.js', 'serviceAccountKey.json']; |
| requiredFiles.forEach(file => { |
| if (!fs.existsSync(file)) { |
| throw new Error(`Missing required file: ${file}`); |
| } |
| }); |
|
|
| |
| console.log('⚡ Starting Titan Nexus Quantum Server...'); |
| console.log('✅ Deployment completed successfully!'); |
| console.log('\n📊 System Information:'); |
| console.log(' - Port: 7860'); |
| console.log(' - AI Model: gemma-3-27b-it'); |
| console.log(' - Publish Interval: 30 minutes'); |
| console.log(' - Security: Sentinel MK2 + Janitor MK2'); |
| |
| } catch (error) { |
| console.error('❌ Deployment failed:', error.message); |
| process.exit(1); |
| } |