Files
smom-dbis-138/scripts/deployment/deploy-z-ecosystem-production.sh
zaragoza444 1cce8ed08f
Some checks failed
CI/CD Pipeline / Solidity Contracts (push) Failing after 1m14s
CI/CD Pipeline / Security Scanning (push) Successful in 2m27s
CI/CD Pipeline / Lint and Format (push) Failing after 45s
CI/CD Pipeline / Terraform Validation (push) Failing after 22s
CI/CD Pipeline / Kubernetes Validation (push) Successful in 25s
Deploy ChainID 138 / Deploy ChainID 138 (push) Failing after 37s
Validation / validate-genesis (push) Successful in 28s
Validation / validate-terraform (push) Failing after 25s
Validation / validate-kubernetes (push) Failing after 10s
Validation / validate-smart-contracts (push) Failing after 11s
Validation / validate-security (push) Failing after 1m16s
Validation / validate-documentation (push) Failing after 18s
Verify Deployment / Verify Deployment (push) Failing after 55s
fix(deploy): run Z API on port 3100 in production to avoid Gitea conflict
Production server binds Gitea on :3000, so token-aggregation now uses
:3100 with a dedicated production env profile and nginx upstream.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-07 07:41:20 -07:00

71 lines
2.5 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.production.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:\${Z_TOKEN_AGGREGATION_PORT:-3100}/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"