Files
proxmox/scripts/copy-to-proxmox.sh
defiQUG fbda1b4beb
Some checks failed
Deploy to Phoenix / deploy (push) Has been cancelled
docs: Ledger Live integration, contract deploy learnings, NEXT_STEPS updates
- ADD_CHAIN138_TO_LEDGER_LIVE: Ledger form done; public code review repo bis-innovations/LedgerLive; init/push commands
- CONTRACT_DEPLOYMENT_RUNBOOK: Chain 138 gas price 1 gwei, 36-addr check, TransactionMirror workaround
- CONTRACT_*: AddressMapper, MirrorManager deployed 2026-02-12; 36-address on-chain check
- NEXT_STEPS_FOR_YOU: Ledger done; steps completable now (no LAN); run-completable-tasks-from-anywhere
- MASTER_INDEX, OPERATOR_OPTIONAL, SMART_CONTRACTS_INVENTORY_SIMPLE: updates
- LEDGER_BLOCKCHAIN_INTEGRATION_COMPLETE: bis-innovations/LedgerLive reference

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-12 15:46:57 -08:00

145 lines
5.2 KiB
Bash
Executable File

#!/usr/bin/env bash
# Copy Deployment Scripts to Proxmox Host
# Copies all necessary deployment scripts and configuration to the Proxmox host
set -euo pipefail
# Suppress locale warnings
export LC_ALL=C
export LANG=C
# Load IP configuration
source "${PROJECT_ROOT}/config/ip-addresses.conf" 2>/dev/null || true
PROXMOX_HOST="${PROXMOX_HOST:-${PROXMOX_HOST_ML110:-192.168.11.10}}"
PROXMOX_USER="${PROXMOX_USER:-root}"
REMOTE_BASE_DIR="${REMOTE_BASE_DIR:-/opt/smom-dbis-138-proxmox}"
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
PROJECT_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)"
echo "========================================="
echo "Copy Deployment Scripts to Proxmox Host"
echo "========================================="
echo ""
echo "Proxmox Host: $PROXMOX_HOST"
echo "User: $PROXMOX_USER"
echo "Remote Directory: $REMOTE_BASE_DIR"
echo ""
# Check if SSH key is available
if ! ssh -o BatchMode=yes -o ConnectTimeout=5 "$PROXMOX_USER@$PROXMOX_HOST" exit 2>/dev/null; then
echo "❌ SSH connection to $PROXMOX_HOST failed"
echo ""
echo "Please ensure:"
echo " 1. SSH key is set up for passwordless access"
echo " 2. Host is reachable: ping $PROXMOX_HOST"
echo " 3. User has access: ssh $PROXMOX_USER@$PROXMOX_HOST"
exit 1
fi
echo "✅ SSH connection successful"
echo ""
# Create remote directory structure
echo "Creating remote directory structure..."
ssh "$PROXMOX_USER@$PROXMOX_HOST" "mkdir -p $REMOTE_BASE_DIR/{scripts/{deployment,validation,network,manage},config,lib,install,logs,docs}" || {
echo "❌ Failed to create remote directories"
exit 1
}
echo "✅ Remote directories created"
echo ""
# Copy configuration files
echo "Copying configuration files..."
scp -r "$PROJECT_ROOT/smom-dbis-138-proxmox/config/"* "$PROXMOX_USER@$PROXMOX_HOST:$REMOTE_BASE_DIR/config/" 2>/dev/null || {
echo "⚠ Configuration files copy had issues (may not exist)"
}
echo "✅ Configuration files copied"
echo ""
# Copy library files
echo "Copying library files..."
if [[ -d "$PROJECT_ROOT/smom-dbis-138-proxmox/lib" ]]; then
scp -r "$PROJECT_ROOT/smom-dbis-138-proxmox/lib/"* "$PROXMOX_USER@$PROXMOX_HOST:$REMOTE_BASE_DIR/lib/" || {
echo "⚠ Library files copy had issues"
}
echo "✅ Library files copied"
else
echo "⚠ lib/ directory not found, skipping"
fi
echo ""
# Copy deployment scripts
echo "Copying deployment scripts..."
if [[ -d "$PROJECT_ROOT/smom-dbis-138-proxmox/scripts/deployment" ]]; then
scp "$PROJECT_ROOT/smom-dbis-138-proxmox/scripts/deployment/"*.sh "$PROXMOX_USER@$PROXMOX_HOST:$REMOTE_BASE_DIR/scripts/deployment/" || {
echo "❌ Failed to copy deployment scripts"
exit 1
}
# Make scripts executable
ssh "$PROXMOX_USER@$PROXMOX_HOST" "chmod +x $REMOTE_BASE_DIR/scripts/deployment/*.sh"
echo "✅ Deployment scripts copied and made executable"
else
echo "❌ scripts/deployment/ directory not found"
exit 1
fi
echo ""
# Copy validation scripts
echo "Copying validation scripts..."
if [[ -d "$PROJECT_ROOT/smom-dbis-138-proxmox/scripts/validation" ]]; then
scp "$PROJECT_ROOT/smom-dbis-138-proxmox/scripts/validation/"*.sh "$PROXMOX_USER@$PROXMOX_HOST:$REMOTE_BASE_DIR/scripts/validation/" 2>/dev/null || {
echo "⚠ Validation scripts copy had issues"
}
ssh "$PROXMOX_USER@$PROXMOX_HOST" "chmod +x $REMOTE_BASE_DIR/scripts/validation/*.sh 2>/dev/null || true"
echo "✅ Validation scripts copied"
else
echo "⚠ scripts/validation/ directory not found"
fi
echo ""
# Copy network scripts
echo "Copying network scripts..."
if [[ -d "$PROJECT_ROOT/smom-dbis-138-proxmox/scripts/network" ]]; then
scp "$PROJECT_ROOT/smom-dbis-138-proxmox/scripts/network/"*.sh "$PROXMOX_USER@$PROXMOX_HOST:$REMOTE_BASE_DIR/scripts/network/" 2>/dev/null || true
ssh "$PROXMOX_USER@$PROXMOX_HOST" "chmod +x $REMOTE_BASE_DIR/scripts/network/*.sh 2>/dev/null || true"
echo "✅ Network scripts copied"
fi
echo ""
# Copy install scripts (if needed)
echo "Copying install scripts..."
if [[ -d "$PROJECT_ROOT/smom-dbis-138-proxmox/install" ]]; then
scp "$PROJECT_ROOT/smom-dbis-138-proxmox/install/"*.sh "$PROXMOX_USER@$PROXMOX_HOST:$REMOTE_BASE_DIR/install/" 2>/dev/null || {
echo "⚠ Install scripts copy had issues"
}
ssh "$PROXMOX_USER@$PROXMOX_HOST" "chmod +x $REMOTE_BASE_DIR/install/*.sh 2>/dev/null || true"
echo "✅ Install scripts copied"
fi
echo ""
# Verify copied files
echo "Verifying copied files..."
echo "Deployment scripts on remote host:"
ssh "$PROXMOX_USER@$PROXMOX_HOST" "ls -lh $REMOTE_BASE_DIR/scripts/deployment/*.sh 2>/dev/null | head -10" || echo " (none found)"
echo ""
echo "========================================="
echo "✅ Files Copied Successfully"
echo "========================================="
echo ""
echo "Remote location: $REMOTE_BASE_DIR"
echo ""
echo "You can now SSH to the Proxmox host and run:"
echo " ssh $PROXMOX_USER@$PROXMOX_HOST"
echo " cd $REMOTE_BASE_DIR"
echo " sudo ./scripts/deployment/deploy-phased.sh --source-project /path/to/smom-dbis-138"
echo ""
echo "Or run remotely:"
echo " ssh $PROXMOX_USER@$PROXMOX_HOST 'cd $REMOTE_BASE_DIR && sudo ./scripts/deployment/deploy-phased.sh --source-project /path/to/smom-dbis-138'"
echo ""