Files
Sankofa/scripts/review-vm-deployments.sh
defiQUG 33d50fb91e
Some checks failed
API CI / API Lint (push) Successful in 47s
API CI / API Type Check (push) Failing after 47s
API CI / API Test (push) Successful in 1m0s
API CI / API Build (push) Failing after 50s
API CI / Build Docker Image (push) Has been skipped
Build Crossplane Provider / build (push) Failing after 5m51s
CD Pipeline / Deploy to Staging (push) Failing after 29s
CI Pipeline / Lint and Type Check (push) Failing after 36s
CI Pipeline / Build (push) Has been skipped
CI Pipeline / Test Backend (push) Failing after 1m33s
CI Pipeline / Test Frontend (push) Failing after 30s
CI Pipeline / Security Scan (push) Failing after 1m16s
Crossplane Provider CI / Go Test (push) Failing after 3m23s
Crossplane Provider CI / Go Lint (push) Failing after 7m27s
Crossplane Provider CI / Go Build (push) Failing after 3m27s
Deploy to Staging / Deploy to Staging (push) Failing after 30s
Portal CI / Portal Lint (push) Failing after 21s
Portal CI / Portal Type Check (push) Failing after 21s
Portal CI / Portal Test (push) Failing after 21s
Portal CI / Portal Build (push) Failing after 22s
Test Suite / frontend-tests (push) Failing after 30s
Test Suite / api-tests (push) Failing after 49s
Test Suite / blockchain-tests (push) Failing after 30s
Type Check / type-check (map[directory:. name:root]) (push) Failing after 23s
Type Check / type-check (map[directory:api name:api]) (push) Failing after 21s
Type Check / type-check (map[directory:portal name:portal]) (push) Failing after 19s
Validate Configuration Files / validate (push) Failing after 1m52s
CD Pipeline / Deploy to Production (push) Has been skipped
chore: consolidate local WIP (repo cleanup 20260707)
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-07 09:41:34 -07:00

113 lines
4.1 KiB
Bash
Executable File

#!/bin/bash
# Review VM Deployment Details
# Analyzes each VM configuration and deployment steps
set -e
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
BLUE='\033[0;34m'
RED='\033[0;31m'
NC='\033[0m'
echo "=========================================="
echo "VM Deployment Review"
echo "=========================================="
echo ""
# Count VMs
TOTAL_VMS=$(find examples/production -name "*.yaml" -type f | wc -l)
echo -e "${BLUE}Total VMs to Deploy:${NC} $TOTAL_VMS"
echo ""
# Categorize VMs
echo -e "${BLUE}VM Categories:${NC}"
echo " Core Infrastructure: $(ls -1 examples/production/*.yaml 2>/dev/null | wc -l)"
echo " Phoenix Infrastructure: $(ls -1 examples/production/phoenix/*.yaml 2>/dev/null | wc -l)"
echo " Blockchain Infrastructure: $(ls -1 examples/production/smom-dbis-138/*.yaml 2>/dev/null | wc -l)"
echo ""
# Review each VM
echo "=========================================="
echo "Detailed VM Configuration Review"
echo "=========================================="
echo ""
VM_COUNT=0
for file in $(find examples/production -name "*.yaml" -type f | sort); do
VM_COUNT=$((VM_COUNT + 1))
VM_NAME=$(basename "$file" .yaml)
CATEGORY=$(dirname "$file" | sed 's|examples/production/||' | sed 's|^\.$|core|')
echo -e "${BLUE}[$VM_COUNT/$TOTAL_VMS] $VM_NAME${NC}"
echo " Category: $CATEGORY"
echo " File: $file"
# Extract configuration
if kubectl apply --dry-run=client -f "$file" -o json 2>/dev/null > /tmp/vm_config.json; then
NODE=$(jq -r '.spec.forProvider.node // "N/A"' /tmp/vm_config.json)
SITE=$(jq -r '.spec.forProvider.site // "N/A"' /tmp/vm_config.json)
CPU=$(jq -r '.spec.forProvider.cpu // "N/A"' /tmp/vm_config.json)
MEMORY=$(jq -r '.spec.forProvider.memory // "N/A"' /tmp/vm_config.json)
DISK=$(jq -r '.spec.forProvider.disk // "N/A"' /tmp/vm_config.json)
STORAGE=$(jq -r '.spec.forProvider.storage // "N/A"' /tmp/vm_config.json)
NETWORK=$(jq -r '.spec.forProvider.network // "N/A"' /tmp/vm_config.json)
IMAGE=$(jq -r '.spec.forProvider.image // "N/A"' /tmp/vm_config.json)
USERDATA=$(jq -r '.spec.forProvider.userData // ""' /tmp/vm_config.json | wc -c)
echo " Configuration:"
echo " Node: $NODE"
echo " Site: $SITE"
echo " CPU: $CPU cores"
echo " Memory: $MEMORY"
echo " Disk: $DISK"
echo " Storage: $STORAGE"
echo " Network: $NETWORK"
echo " Image: $IMAGE"
if [ "$USERDATA" -gt 10 ]; then
echo " Cloud-init: ✅ Configured"
else
echo " Cloud-init: ⚠️ Not configured"
fi
# Check current status
if kubectl get proxmoxvm "$VM_NAME" -o json 2>/dev/null > /tmp/vm_status.json; then
VMID=$(jq -r '.status.vmId // "pending"' /tmp/vm_status.json)
STATE=$(jq -r '.status.state // "creating"' /tmp/vm_status.json)
echo " Status:"
echo " VMID: $VMID"
echo " State: $STATE"
else
echo " Status: Not yet deployed"
fi
echo ""
else
echo -e "${RED} Error: Cannot read configuration${NC}"
echo ""
fi
done
# Summary
echo "=========================================="
echo "Deployment Summary"
echo "=========================================="
echo ""
echo "Total VMs: $TOTAL_VMS"
echo ""
# Count by node
echo "VMs by Node:"
find examples/production -name "*.yaml" -type f -exec sh -c 'kubectl apply --dry-run=client -f "$1" -o json 2>/dev/null | jq -r ".spec.forProvider.node // \"unknown\""' _ {} \; | sort | uniq -c
echo ""
echo "VMs by Site:"
find examples/production -name "*.yaml" -type f -exec sh -c 'kubectl apply --dry-run=client -f "$1" -o json 2>/dev/null | jq -r ".spec.forProvider.site // \"unknown\""' _ {} \; | sort | uniq -c
echo ""
echo "VMs by Storage:"
find examples/production -name "*.yaml" -type f -exec sh -c 'kubectl apply --dry-run=client -f "$1" -o json 2>/dev/null | jq -r ".spec.forProvider.storage // \"unknown\""' _ {} \; | sort | uniq -c
rm -f /tmp/vm_config.json /tmp/vm_status.json