Some checks failed
CI/CD Pipeline / Solidity Contracts (push) Failing after 1m35s
CI/CD Pipeline / Security Scanning (push) Successful in 2m46s
CI/CD Pipeline / Lint and Format (push) Failing after 53s
CI/CD Pipeline / Terraform Validation (push) Failing after 31s
CI/CD Pipeline / Kubernetes Validation (push) Successful in 30s
Deploy ChainID 138 / Deploy ChainID 138 (push) Failing after 50s
HYBX OMNL TypeScript & anchor / token-aggregation build + reconcile artifact (push) Failing after 36s
Validation / validate-genesis (push) Successful in 32s
Validation / validate-terraform (push) Failing after 31s
Validation / validate-kubernetes (push) Failing after 14s
Validation / validate-smart-contracts (push) Failing after 16s
Validation / validate-security (push) Failing after 1m38s
Validation / validate-documentation (push) Failing after 26s
Verify Deployment / Verify Deployment (push) Failing after 1m0s
Redirect legacy ALI_* docs to Zardasht canonical workflow, delegate sync-ali to proxmox zardasht:banking-portal:sync, and align host config with /srv/zardasht-portal deploy root. Co-authored-by: Cursor <cursoragent@cursor.com>
91 lines
3.6 KiB
Bash
91 lines
3.6 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
|
|
# Prefer from proxmox: pnpm zardasht:banking-portal:sync
|
|
|
|
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"
|
|
omnl_pve_ssh "pct exec ${CTID} -- bash ${OMNL_PORTAL_ROOT:-/srv/zardasht-portal}/scripts/deployment/start-omnl-banking-portal.sh" 2>/dev/null || log "WARN: portal restart failed for CT $CTID"
|
|
done
|
|
else
|
|
log "WARN: no $ENV_FILE — skip LXC Fineract env"
|
|
fi
|
|
|
|
log "=== 4b Super-admin DB seed (control panel) ==="
|
|
if [[ -f "$ENV_FILE" ]] && [[ "${SEED_SUPER_ADMIN_USERS:-1}" == "1" ]]; then
|
|
set -a
|
|
set +u
|
|
# shellcheck disable=SC1090
|
|
source "$ENV_FILE"
|
|
set -u
|
|
set +a
|
|
if [[ -n "${DATABASE_URL:-}" ]]; then
|
|
node scripts/deployment/seed-omnl-super-admin-users.mjs --stop-services | tee "$HOME/omnl-super-admin-credentials.txt" || log "WARN: super-admin user seed failed"
|
|
else
|
|
log "WARN: DATABASE_URL unset — skip super-admin user seed"
|
|
fi
|
|
fi
|
|
|
|
log "=== 5/5 Office 24 opening journal (activate live ledgers) ==="
|
|
MATERIAL_OPENING_USD="${OMNL_MATERIAL_OPENING_THRESHOLD:-10000000}"
|
|
STATUS_FILE="$REPO_DIR/config/omnl-hospitallers-office24-status.v1.json"
|
|
if [[ "$SEED_JOURNAL" == "1" ]] && [[ -f "$ENV_FILE" ]]; then
|
|
set -a
|
|
set +u
|
|
# shellcheck disable=SC1090
|
|
source "$ENV_FILE"
|
|
set -u
|
|
set +a
|
|
if [[ -f "$STATUS_FILE" ]] && grep -q '"fundingPosted"[[:space:]]*:[[:space:]]*true' "$STATUS_FILE" 2>/dev/null; then
|
|
log "Office 24 fundingPosted=true in status SSOT — skip single-leg seed (journal already live)"
|
|
elif [[ -n "${OFFICE24_OPENING_M1_USD:-}" ]]; then
|
|
opening_amt="${OFFICE24_OPENING_M1_USD//,/}"
|
|
if awk -v amt="$opening_amt" -v lim="$MATERIAL_OPENING_USD" 'BEGIN { exit !(amt >= lim) }'; then
|
|
log "Material opening amount ($OFFICE24_OPENING_M1_USD) — skip single-leg seed (use 1b canary/execute matrix)"
|
|
else
|
|
node scripts/deployment/seed-office-24-opening-journal.mjs
|
|
bash scripts/deployment/deploy-omnl-bank-production.sh
|
|
fi
|
|
else
|
|
log "OFFICE24_OPENING_M1_USD not set — ledger reads live Fineract only (no seed)"
|
|
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"
|