#!/bin/bash # # Phase 11: Frontend Applications Deployment # Deploy portal applications to the Sankofa Phoenix / Proxmox runtime. # set -euo pipefail SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" source "${SCRIPT_DIR}/config.sh" log_info "==========================================" log_info "Phase 11: Frontend Applications Deployment" log_info "==========================================" log_step "11.1 Deploying portal-public to the Order runtime CT..." bash "${SCRIPT_DIR}/sync-portal-public-to-sankofa-phoenix.sh" || error_exit "Failed to sync portal-public to Sankofa Phoenix" log_step "11.2 Refreshing the Order HAProxy edge..." env \ ORDER_HAPROXY_BACKEND_HOST="${ORDER_HAPROXY_BACKEND_HOST}" \ ORDER_HAPROXY_BACKEND_PORT="${ORDER_HAPROXY_BACKEND_PORT}" \ PROXMOX_ORDER_HAPROXY_NODE="${ORDER_HAPROXY_HOST}" \ bash "${PROJECT_ROOT}/../scripts/deployment/provision-order-haproxy-10210.sh" \ || error_exit "Failed to refresh order-haproxy" log_step "11.3 Verifying LAN and public health..." curl -fsS "http://${ORDER_PORTAL_PUBLIC_IP}:${ORDER_PORTAL_PUBLIC_PORT}/api/health" >/dev/null \ && log_success "Direct CT health check passed" \ || log_warning "Direct CT health check failed" curl -fsS -H "Host: the-order.sankofa.nexus" "http://${ORDER_HAPROXY_IP}/api/health" >/dev/null \ && log_success "HAProxy health check passed" \ || log_warning "HAProxy health check failed" curl -fsS "${THE_ORDER_PUBLIC_URL}/api/health" >/dev/null \ && log_success "Public health check passed" \ || log_warning "Public health check failed" # Save state save_state "phase11" "complete" log_success "==========================================" log_success "Phase 11: Frontend Applications - COMPLETE" log_success "=========================================="