Files
the_order/scripts/deploy/phase4-database-storage.sh
T

50 lines
1.6 KiB
Bash
Executable File

#!/bin/bash
#
# Phase 4: Database & Storage Setup
# Validate PostgreSQL, storage, Redis, and search configuration inputs for the Sankofa runtime.
#
set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
source "${SCRIPT_DIR}/config.sh"
log_info "=========================================="
log_info "Phase 4: Database & Storage Setup"
log_info "=========================================="
log_step "4.1 Checking database configuration inputs..."
if [ -n "${DATABASE_URL:-}" ]; then
log_success "DATABASE_URL is set"
else
log_warning "DATABASE_URL is not set. Phase 7 will require it."
fi
if [ -n "${ORDER_POSTGRES_PRIMARY:-}" ]; then
log_info "Order PostgreSQL primary: ${ORDER_POSTGRES_PRIMARY}"
fi
log_step "4.2 Checking storage configuration inputs..."
if [ -n "${ORDER_STORAGE_ROOT:-}" ]; then
log_success "ORDER_STORAGE_ROOT is set to ${ORDER_STORAGE_ROOT}"
else
log_warning "ORDER_STORAGE_ROOT is not set. Configure it if document storage is required."
fi
log_step "4.3 Checking Redis / search configuration inputs..."
if [ -n "${ORDER_REDIS_IP:-}" ]; then
log_info "Order Redis host: ${ORDER_REDIS_IP}"
fi
if [ -n "${IP_ORDER_OPENSEARCH:-}" ]; then
log_info "Order OpenSearch host: ${IP_ORDER_OPENSEARCH}"
fi
log_info "Database and storage validation complete. Create or update the underlying services through the Proxmox runtime as needed."
# Save state
save_state "phase4" "complete"
log_success "=========================================="
log_success "Phase 4: Database & Storage - COMPLETE"
log_success "=========================================="