Files
smom-dbis-138/scripts/deployment/deploy-z-ecosystem-production.sh
zaragoza444 a2db92f3cb
Some checks failed
CI/CD Pipeline / Solidity Contracts (push) Failing after 1m14s
CI/CD Pipeline / Security Scanning (push) Successful in 2m34s
CI/CD Pipeline / Lint and Format (push) Failing after 40s
CI/CD Pipeline / Terraform Validation (push) Failing after 24s
CI/CD Pipeline / Kubernetes Validation (push) Successful in 26s
Deploy ChainID 138 / Deploy ChainID 138 (push) Failing after 37s
HYBX OMNL TypeScript & anchor / token-aggregation build + reconcile artifact (push) Failing after 22s
Validation / validate-genesis (push) Successful in 24s
Validation / validate-terraform (push) Failing after 24s
Validation / validate-kubernetes (push) Failing after 9s
Validation / validate-smart-contracts (push) Failing after 10s
Validation / validate-security (push) Failing after 1m22s
Validation / validate-documentation (push) Failing after 17s
Verify Deployment / Verify Deployment (push) Failing after 47s
feat: split Z Ecosystem from OMNL/DBIS with separate builds and deploy
Add VITE_ECOSYSTEM build profiles, Z-only nginx vhosts, standalone Z production stack script, and remove Z Chain from OMNL registry.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-07 05:17:40 -07:00

71 lines
2.4 KiB
Bash

#!/usr/bin/env bash
# Production deploy: Z Ecosystem on zblockchainsystem.com (separate from OMNL portals).
set -euo pipefail
ROOT="$(cd "$(dirname "$0")/../.." && pwd)"
ENV_FILE="${Z_ECOSYSTEM_ENV:-$ROOT/config/z-ecosystem.local.env}"
PROD_CFG="$ROOT/config/z-chain-production.v1.json"
DOMAIN_CFG="$ROOT/config/z-ecosystem-production-domains.v1.json"
log() { echo "[$(date -Iseconds)] $*"; }
if [[ -f "$ROOT/.env" ]]; then
set -a
set +u
# shellcheck disable=SC1090
source "$ROOT/.env"
set -u
set +a
fi
if [[ -f "$ENV_FILE" ]]; then
set -a
set +u
# shellcheck disable=SC1090
source "$ENV_FILE"
set -u
set +a
fi
export CHAIN_900002_RPC_URL="${CHAIN_900002_RPC_URL:-https://rpc.zblockchainsystem.com}"
export VITE_RPC_URL_900002="${VITE_RPC_URL_900002:-$CHAIN_900002_RPC_URL}"
export VITE_Z_CHAIN_EXPLORER_URL="${VITE_Z_CHAIN_EXPLORER_URL:-https://explorer.zblockchainsystem.com}"
export VITE_Z_ECOSYSTEM_URL="${VITE_Z_ECOSYSTEM_URL:-https://zblockchainsystem.com}"
export VITE_ENABLE_Z_WALLET="${VITE_ENABLE_Z_WALLET:-true}"
export VITE_TOKEN_AGGREGATION_URL="${VITE_TOKEN_AGGREGATION_URL:-/api/v1}"
export VITE_SETTLEMENT_MIDDLEWARE_URL="${VITE_SETTLEMENT_MIDDLEWARE_URL:-/settlement}"
export VITE_DBIS_EXCHANGE_URL="${VITE_DBIS_EXCHANGE_URL:-/exchange}"
log "Z Ecosystem production deploy (zblockchainsystem.com)"
log " chain: $PROD_CFG"
log " domain: $DOMAIN_CFG"
log " portal: $VITE_Z_ECOSYSTEM_URL"
log " rpc: $CHAIN_900002_RPC_URL"
if [[ "${Z_CHAIN_BOOTSTRAP_PROD:-0}" == "1" ]]; then
log "Bootstrapping Besu Z Chain..."
sudo bash "$ROOT/scripts/deployment/bootstrap-z-chain-production.sh"
fi
if [[ "${Z_CHAIN_DEPLOY_CONTRACTS:-0}" == "1" ]]; then
log "Deploying Z Chain contracts..."
node "$ROOT/scripts/deployment/deploy-z-chain-contracts.js" --network zchain
node "$ROOT/scripts/deployment/sync-z-chain-deployed-addresses.mjs"
fi
log "Build Z-only backend + frontend..."
bash "$ROOT/scripts/deployment/build-z-ecosystem-stack.sh"
log "Install Z domain nginx vhost..."
bash "$ROOT/scripts/deployment/deploy-z-domains.sh"
if [[ "${Z_ECOSYSTEM_PUSH_PCT:-0}" == "1" ]]; then
log "Pushing portal bundle to Proxmox LXC..."
bash "$ROOT/scripts/deployment/deploy-omnl-banking-portal-pct.sh"
fi
log "Done. Verify:"
log " curl -sf http://127.0.0.1:3000/api/v1/z-bot/health"
log " curl -sf http://127.0.0.1:3011/api/v1/settlement/health"
log " curl -sI https://zblockchainsystem.com/z"
log " bash scripts/deployment/print-z-dns-records.sh"