Files
smom-dbis-138/scripts/deployment/deploy-omnl-banking-portal-pct.sh
zaragoza444 d182a1d624
Some checks failed
CI/CD Pipeline / Solidity Contracts (push) Failing after 1m20s
CI/CD Pipeline / Security Scanning (push) Successful in 2m35s
CI/CD Pipeline / Lint and Format (push) Failing after 53s
CI/CD Pipeline / Terraform Validation (push) Failing after 27s
CI/CD Pipeline / Kubernetes Validation (push) Successful in 26s
Deploy ChainID 138 / Deploy ChainID 138 (push) Failing after 42s
Validation / validate-genesis (push) Successful in 28s
Validation / validate-terraform (push) Failing after 25s
Validation / validate-kubernetes (push) Failing after 9s
Validation / validate-smart-contracts (push) Failing after 9s
Validation / validate-security (push) Failing after 1m16s
Validation / validate-documentation (push) Failing after 23s
Verify Deployment / Verify Deployment (push) Failing after 57s
fix: nginx API proxy inside banking portal LXCs
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-28 19:48:00 -07:00

75 lines
2.3 KiB
Bash
Executable File

#!/usr/bin/env bash
# Deploy OMNL banking portal into Proxmox LXC via pct.
set -euo pipefail
REPO_DIR="${OMNL_BANK_ROOT:-$HOME/smom-dbis-138}"
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
# shellcheck source=lib/omnl-pve-ssh.sh
source "${SCRIPT_DIR}/lib/omnl-pve-ssh.sh"
CTID="${OMNL_PCT_CTID:-5825}"
PORTAL_ROOT="${OMNL_PORTAL_ROOT:-/srv/ali-portal}"
PROJECT_SRC="${OMNL_PROJECT_SRC:-/home/projects/exchange}"
STAGE="/tmp/omnl-banking-portal-$(date +%Y%m%d%H%M%S).tar.gz"
log() { echo "[$(date -Iseconds)] $*"; }
pct_exec() {
omnl_pve_ssh "pct exec ${CTID} -- $*"
}
pve_exec() {
omnl_pve_ssh "$*"
}
omnl_pve_preflight
if ! omnl_pve_ensure_ct_running "$CTID"; then
log "Skip CT ${CTID} — not available on PVE"
exit 2
fi
if [[ "${OMNL_SKIP_BUILD:-0}" != "1" ]]; then
log "Building OMNL stack at $REPO_DIR..."
cd "$REPO_DIR"
bash scripts/deployment/deploy-omnl-bank-production.sh
else
log "Skipping build (OMNL_SKIP_BUILD=1) — using existing dist/ artifacts"
cd "$REPO_DIR"
fi
log "Staging bundle for CT ${CTID}..."
tar -czf "$STAGE" \
-C "$REPO_DIR" \
config \
frontend-dapp/dist \
packages/integration-foundation/dist \
packages/settlement-core/dist \
services/token-aggregation/dist \
services/token-aggregation/package.json \
services/token-aggregation/package-lock.json \
services/settlement-middleware/dist \
services/settlement-middleware/package.json \
services/settlement-middleware/package-lock.json \
services/dbis-exchange/dist \
services/dbis-exchange/package.json \
services/dbis-exchange/package-lock.json \
scripts/deployment/start-omnl-banking-portal.sh \
deploy/nginx/omnl-lxc-portal.conf
log "Push to PVE host ${OMNL_PVE_SSH_TARGET}..."
omnl_pve_scp "$STAGE" "${OMNL_PVE_SSH_TARGET}:/tmp/omnl-portal.tar.gz"
rm -f "$STAGE"
log "Install into CT $CTID at $PORTAL_ROOT..."
pve_exec "pct push ${CTID} /tmp/omnl-portal.tar.gz /tmp/omnl-portal.tar.gz"
pct_exec "mkdir -p ${PORTAL_ROOT} ${PROJECT_SRC}"
pct_exec "tar -xzf /tmp/omnl-portal.tar.gz -C ${PORTAL_ROOT}"
pct_exec "ln -sfn ${PORTAL_ROOT} ${PROJECT_SRC}/omnl-live || true"
pct_exec "chmod +x ${PORTAL_ROOT}/scripts/deployment/start-omnl-banking-portal.sh"
log "Start services inside CT..."
pct_exec "bash ${PORTAL_ROOT}/scripts/deployment/start-omnl-banking-portal.sh"
log "Done — portal root: ${PORTAL_ROOT} (CT ${CTID} on ${OMNL_PVE_SSH_TARGET})"