fix: sync only running banking LXCs 5825-5828 on r630-03
Some checks failed
CI/CD Pipeline / Solidity Contracts (push) Failing after 1m21s
CI/CD Pipeline / Security Scanning (push) Successful in 2m31s
CI/CD Pipeline / Lint and Format (push) Failing after 46s
CI/CD Pipeline / Terraform Validation (push) Failing after 31s
CI/CD Pipeline / Kubernetes Validation (push) Successful in 28s
Deploy ChainID 138 / Deploy ChainID 138 (push) Failing after 45s
HYBX OMNL TypeScript & anchor / token-aggregation build + reconcile artifact (push) Failing after 40s
Validation / validate-genesis (push) Successful in 31s
Validation / validate-terraform (push) Failing after 26s
Validation / validate-kubernetes (push) Failing after 10s
Validation / validate-smart-contracts (push) Failing after 13s
Validation / validate-security (push) Failing after 1m28s
Validation / validate-documentation (push) Failing after 25s
Verify Deployment / Verify Deployment (push) Failing after 1m3s

Load CTIDs from config, ensure containers are running before pct push, and skip missing legacy IDs instead of failing the whole sync.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-06-28 17:35:30 -07:00
parent 3a7358b6b5
commit 324bdc33fd
5 changed files with 95 additions and 5 deletions

View File

@@ -12,7 +12,8 @@
"proxmox": {
"host": "192.168.11.13",
"access": "ssh root@192.168.11.13 then pct exec <CTID>",
"bankingLxcRange": "5820-5828",
"bankingLxcRange": "5825-5828",
"bankingLxcConfig": "config/omnl-banking-portal-lxcs.v1.json",
"exampleCtid": 5825
},
"bankingLxc": {

View File

@@ -0,0 +1,31 @@
{
"version": "1.0.0",
"description": "Banking portal LXCs on Proxmox r630-03 (192.168.11.13). NPMplus maps nine public FQDNs to these four stacks.",
"pveHost": "192.168.11.13",
"pveNode": "r630-03",
"portalRoot": "/srv/ali-portal",
"containers": [
{
"ctid": 5825,
"name": "omnl-office24-portal",
"products": ["office-24", "digital-swap"]
},
{
"ctid": 5826,
"name": "dbis-exchange-portal",
"products": ["dbis-trade"]
},
{
"ctid": 5827,
"name": "dbis-secure-portal",
"products": ["central-bank", "online-banking"]
},
{
"ctid": 5828,
"name": "dbis-forex-portal",
"products": ["forex-trade"]
}
],
"legacyPlannedCtids": [5820, 5821, 5822, 5823, 5824],
"notes": "58205824 are not provisioned on r630-03; use these four running CTIDs for sync."
}

View File

@@ -24,6 +24,11 @@ pve_exec() {
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"

View File

@@ -57,3 +57,26 @@ omnl_pve_preflight() {
return 1
}
}
omnl_pve_ensure_ct_running() {
local ctid="$1"
local status
status="$(omnl_pve_ssh "pct status ${ctid} 2>/dev/null || true")"
if [[ -z "$status" ]]; then
echo "CT ${ctid} does not exist on ${OMNL_PVE_SSH_TARGET} — skip" >&2
return 1
fi
if [[ "$status" == *"status: running"* ]]; then
return 0
fi
if [[ "$status" == *"status: stopped"* ]]; then
log_msg "Starting stopped CT ${ctid}..."
omnl_pve_ssh "pct start ${ctid}"
sleep 3
return 0
fi
echo "CT ${ctid} is not runnable (${status})" >&2
return 1
}
log_msg() { echo "[$(date -Iseconds)] $*" >&2; }

View File

@@ -1,17 +1,16 @@
#!/usr/bin/env bash
# Sync OMNL banking portal to all Ali banking LXCs (58205828) via Proxmox pct.
# Sync OMNL banking portal to banking LXCs via Proxmox pct.
set -euo pipefail
REPO_DIR="${OMNL_BANK_ROOT:-$HOME/smom-dbis-138}"
DEPLOY_SCRIPT="${REPO_DIR}/scripts/deployment/deploy-omnl-banking-portal-pct.sh"
LXC_CONFIG="${OMNL_BANKING_LXC_CONFIG:-$REPO_DIR/config/omnl-banking-portal-lxcs.v1.json}"
APPLY=false
if [[ "${1:-}" == "--apply" ]]; then
APPLY=true
fi
CTIDS=(5820 5821 5822 5823 5824 5825 5826 5827 5828)
log() { echo "[$(date -Iseconds)] $*"; }
if [[ ! -f "$DEPLOY_SCRIPT" ]]; then
@@ -19,6 +18,24 @@ if [[ ! -f "$DEPLOY_SCRIPT" ]]; then
exit 1
fi
read_ctids() {
if [[ -n "${OMNL_BANKING_LXC_CTIDS:-}" ]]; then
# shellcheck disable=SC2206
CTIDS=(${OMNL_BANKING_LXC_CTIDS})
return
fi
if command -v node >/dev/null 2>&1 && [[ -f "$LXC_CONFIG" ]]; then
mapfile -t CTIDS < <(node -e "
const c=require(process.argv[1]);
for (const x of c.containers||[]) console.log(x.ctid);
" "$LXC_CONFIG")
return
fi
CTIDS=(5825 5826 5827 5828)
}
read_ctids
# shellcheck source=lib/omnl-pve-ssh.sh
source "${REPO_DIR}/scripts/deployment/lib/omnl-pve-ssh.sh"
omnl_pve_preflight
@@ -26,6 +43,7 @@ omnl_pve_preflight
log "OMNL banking LXC sync — CTIDs: ${CTIDS[*]}"
log "Mode: $(if $APPLY; then echo APPLY; else echo DRY-RUN; fi)"
log "Repo: $REPO_DIR"
log "Config: $LXC_CONFIG"
log "PVE: ${OMNL_PVE_SSH_TARGET} (sudo prefix: ${OMNL_PVE_SSH_PREFIX[*]:-none})"
if $APPLY; then
@@ -34,17 +52,29 @@ if $APPLY; then
bash scripts/deployment/deploy-omnl-bank-production.sh
fi
synced=0
skipped=0
for CTID in "${CTIDS[@]}"; do
if $APPLY; then
log "Deploying CT $CTID..."
set +e
OMNL_SKIP_BUILD=1 OMNL_PCT_CTID="$CTID" OMNL_BANK_ROOT="$REPO_DIR" bash "$DEPLOY_SCRIPT"
rc=$?
set -e
if [[ $rc -eq 0 ]]; then
synced=$((synced + 1))
elif [[ $rc -eq 2 ]]; then
skipped=$((skipped + 1))
else
log "WARN: deploy failed for CT $CTID (exit $rc, continuing)"
fi
else
log "Would deploy CT $CTID → /srv/ali-portal (pct exec on ${OMNL_PVE_SSH_TARGET})"
fi
done
if $APPLY; then
log "All ${#CTIDS[@]} banking LXCs synced."
log "Synced ${synced}/${#CTIDS[@]} banking LXCs (${skipped} skipped)."
else
log "Dry-run complete. Re-run with --apply to deploy."
fi