Files
the_order/scripts/deploy/phase15-production.sh
T

49 lines
1.7 KiB
Bash
Executable File

#!/bin/bash
#
# Phase 15: Production Hardening
# Resource limits, backups, disaster recovery, documentation
#
set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
source "${SCRIPT_DIR}/config.sh"
log_info "=========================================="
log_info "Phase 15: Production Hardening"
log_info "=========================================="
# 15.1 Production Configuration
log_step "15.1 Configuring production settings..."
if [ "${ENVIRONMENT}" != "prod" ]; then
log_warning "Not production environment. Skipping production hardening."
exit 0
fi
log_info "Production runtime target: ${ORDER_PORTAL_PUBLIC_VMID} -> ${ORDER_HAPROXY_VMID} -> ${THE_ORDER_PUBLIC_URL}"
log_step "15.2 Verifying production health..."
curl -fsS "${THE_ORDER_PUBLIC_URL}/api/health" >/dev/null \
&& log_success "Production public health check passed" \
|| log_warning "Production public health check failed"
log_step "15.3 Backup / DR reminders..."
log_info "Ensure CT backups for ${ORDER_PORTAL_PUBLIC_VMID} and ${ORDER_HAPROXY_VMID} are present in the Proxmox schedule."
log_info "Ensure database backups are configured in the backing datastore used by The Order."
log_info "Production hardening complete"
log_info "Next steps (manual):"
log_info " 1. Review CT CPU / memory limits"
log_info " 2. Confirm Proxmox backup coverage"
log_info " 3. Confirm database backup coverage"
log_info " 4. Review public health and uptime monitors"
log_info " 5. Update documentation"
# Save state
save_state "phase15" "complete"
log_success "=========================================="
log_success "Phase 15: Production Hardening - COMPLETE"
log_success "=========================================="