Files
smom-dbis-138/scripts/deployment/activate-omnl-production.sh
zaragoza444 17e5cb3222
Some checks failed
CI/CD Pipeline / Solidity Contracts (push) Failing after 1m29s
CI/CD Pipeline / Security Scanning (push) Successful in 3m16s
CI/CD Pipeline / Lint and Format (push) Failing after 46s
CI/CD Pipeline / Terraform Validation (push) Failing after 25s
CI/CD Pipeline / Kubernetes Validation (push) Successful in 27s
Deploy ChainID 138 / Deploy ChainID 138 (push) Failing after 52s
HYBX OMNL TypeScript & anchor / token-aggregation build + reconcile artifact (push) Failing after 30s
Validation / validate-genesis (push) Successful in 27s
Validation / validate-terraform (push) Failing after 30s
Validation / validate-kubernetes (push) Failing after 11s
Validation / validate-smart-contracts (push) Failing after 10s
Validation / validate-security (push) Failing after 1m31s
Validation / validate-documentation (push) Failing after 19s
Verify Deployment / Verify Deployment (push) Failing after 59s
chore: sync Office 24 Zardasht identity and deploy paths
Align externalId, office name, and portal topology with live Fineract
(HOSPITALLERS-ZARDASHT-IRAQ-IRAN). Default LXC root to /srv/zardasht-portal
and SSH alias dev-bis-zardasht in host config.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-29 01:58:03 -07:00

65 lines
2.5 KiB
Bash

#!/usr/bin/env bash
# Full OMNL production activation: deploy stack, nginx domains, LXCs, optional opening journal.
set -euo pipefail
REPO_DIR="${OMNL_BANK_ROOT:-$HOME/smom-dbis-138}"
ENV_FILE="${OMNL_BANK_ENV:-$REPO_DIR/.env}"
SEED_JOURNAL="${SEED_OFFICE24_JOURNAL:-1}"
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
# shellcheck source=lib/omnl-pve-ssh.sh
source "${SCRIPT_DIR}/lib/omnl-pve-ssh.sh"
log() { echo "[$(date -Iseconds)] $*"; }
cd "$REPO_DIR"
git pull --ff-only origin main
log "=== 1/5 Deploy OMNL bank stack on dev ==="
bash scripts/deployment/deploy-omnl-bank-production.sh
log "=== 2/5 Install nginx domain routing (online + central bank + trade) ==="
bash scripts/deployment/deploy-omnl-domains.sh
log "=== 3/5 Sync banking portal LXCs (5825-5828) ==="
bash scripts/deployment/sync-ali-omnl-banking-portal-lxcs.sh --apply
log "=== 4/5 Push Fineract/API env to each LXC ==="
if [[ -f "$ENV_FILE" ]]; then
for CTID in 5825 5826 5827 5828; do
bash scripts/deployment/push-portal-env-to-lxc.sh "$CTID" || log "WARN: env push failed for CT $CTID"
omnl_pve_ssh "pct exec ${CTID} -- bash ${OMNL_PORTAL_ROOT:-/srv/zardasht-portal}/scripts/deployment/start-omnl-banking-portal.sh" 2>/dev/null || true
done
else
log "WARN: no $ENV_FILE — skip LXC Fineract env"
fi
log "=== 5/5 Office 24 opening journal (activate live ledgers) ==="
if [[ "$SEED_JOURNAL" == "1" ]] && [[ -f "$ENV_FILE" ]]; then
set -a
# shellcheck disable=SC1090
source "$ENV_FILE"
set +a
if [[ -n "${OFFICE24_OPENING_M1_USD:-}" ]]; then
node scripts/deployment/seed-office-24-opening-journal.mjs
bash scripts/deployment/deploy-omnl-bank-production.sh
else
log "OFFICE24_OPENING_M1_USD not set — ledger stays connected-but-empty (fineractLive=false)"
log "Set OFFICE24_OPENING_M1_USD in .env and re-run: bash scripts/deployment/activate-omnl-production.sh"
fi
else
log "Journal seed skipped (SEED_OFFICE24_JOURNAL=$SEED_JOURNAL)"
fi
log "=== Production URLs ==="
log " Central Bank: https://secure.d-bis.org/central-bank"
log " Online banking: https://online.omdnl.org/central-bank"
log " Office 24: https://office24.omdnl.org/office-24"
log " DBIS Trade: https://exchange.d-bis.org/trade"
log " Digital Swap: https://digital.omdnl.org/swap"
log "=== Health ==="
curl -sf http://127.0.0.1:3011/api/v1/settlement/health | head -c 120 || true
echo
curl -sf http://127.0.0.1:3011/api/v1/settlement/money-supply/public | head -c 300 || true
echo
log "Activation complete"