CalejoControl/start-remote-test.sh

63 lines
1.9 KiB
Bash

#!/bin/bash
# Calejo Control Adapter - Remote Test Environment
# Starts the dashboard locally but configured to work with remote services
set -e
echo "🚀 Starting Calejo Control Adapter - Remote Test Environment"
echo "=========================================================="
# Check if Python is available
if ! command -v python &> /dev/null; then
echo "❌ Python is not installed or not in PATH"
exit 1
fi
# Check if we're in the right directory
if [ ! -f "start_dashboard.py" ]; then
echo "❌ Please run this script from the calejo-control-adapter directory"
exit 1
fi
# Set environment variables for remote testing
export CALEJO_CONFIG_FILE="config/test-remote.yml"
export CALEJO_LOG_LEVEL="INFO"
export CALEJO_DEBUG="true"
# Test remote services connectivity
echo ""
echo "🔍 Testing remote service connectivity..."
# Test Mock SCADA Service
if curl -s --connect-timeout 5 http://95.111.206.155:8083/health > /dev/null; then
echo "✅ Mock SCADA Service (8083): ACCESSIBLE"
else
echo "❌ Mock SCADA Service (8083): NOT ACCESSIBLE"
fi
# Test Mock Optimizer Service
if curl -s --connect-timeout 5 http://95.111.206.155:8084/health > /dev/null; then
echo "✅ Mock Optimizer Service (8084): ACCESSIBLE"
else
echo "❌ Mock Optimizer Service (8084): NOT ACCESSIBLE"
fi
# Test Existing API
if curl -s --connect-timeout 5 http://95.111.206.155:8080/health > /dev/null; then
echo "✅ Existing Calejo API (8080): ACCESSIBLE"
else
echo "❌ Existing Calejo API (8080): NOT ACCESSIBLE"
fi
echo ""
echo "📊 Starting Dashboard on port 8081..."
echo " - Local Dashboard: http://localhost:8081"
echo " - Remote Services: http://95.111.206.155:8083,8084"
echo " - Discovery API: http://localhost:8081/api/v1/dashboard/discovery"
echo ""
echo "Press Ctrl+C to stop the dashboard"
echo ""
# Start the dashboard
python start_dashboard.py