Files
smom-dbis-138/scripts/azure/continue-fix-if-needed.sh
defiQUG 1fb7266469 Add Oracle Aggregator and CCIP Integration
- Introduced Aggregator.sol for Chainlink-compatible oracle functionality, including round-based updates and access control.
- Added OracleWithCCIP.sol to extend Aggregator with CCIP cross-chain messaging capabilities.
- Created .gitmodules to include OpenZeppelin contracts as a submodule.
- Developed a comprehensive deployment guide in NEXT_STEPS_COMPLETE_GUIDE.md for Phase 2 and smart contract deployment.
- Implemented Vite configuration for the orchestration portal, supporting both Vue and React frameworks.
- Added server-side logic for the Multi-Cloud Orchestration Portal, including API endpoints for environment management and monitoring.
- Created scripts for resource import and usage validation across non-US regions.
- Added tests for CCIP error handling and integration to ensure robust functionality.
- Included various new files and directories for the orchestration portal and deployment scripts.
2025-12-12 14:57:48 -08:00

87 lines
3.0 KiB
Bash
Executable File

#!/usr/bin/env bash
# Continue fix if script didn't complete all steps
set -e
SUBSCRIPTION_ID="fc08d829-4f14-413d-ab27-ce024425db0b"
TERRAFORM_DIR="$HOME/projects/smom-dbis-138/terraform/well-architected/cloud-sovereignty"
echo "=== Continuing Fix Process ==="
echo ""
# Check if failed clusters still exist
FAILED_COUNT=$(az aks list --subscription "$SUBSCRIPTION_ID" \
--query "[?contains(name, 'az-p-') && provisioningState == 'Failed'].name" -o tsv 2>/dev/null | wc -l)
CANCELED_COUNT=$(az aks list --subscription "$SUBSCRIPTION_ID" \
--query "[?contains(name, 'az-p-') && provisioningState == 'Canceled'].name" -o tsv 2>/dev/null | wc -l)
DELETING_COUNT=$(az aks list --subscription "$SUBSCRIPTION_ID" \
--query "[?contains(name, 'az-p-') && provisioningState == 'Deleting'].name" -o tsv 2>/dev/null | wc -l)
echo "Current Status:"
echo " Failed clusters: $FAILED_COUNT"
echo " Canceled clusters: $CANCELED_COUNT"
echo " Deleting clusters: $DELETING_COUNT"
echo ""
if [ "$DELETING_COUNT" -gt 0 ]; then
echo "⏳ Waiting for deletions to complete..."
while [ "$DELETING_COUNT" -gt 0 ]; do
sleep 10
DELETING_COUNT=$(az aks list --subscription "$SUBSCRIPTION_ID" \
--query "[?contains(name, 'az-p-') && provisioningState == 'Deleting'].name" -o tsv 2>/dev/null | wc -l)
echo " Still deleting: $DELETING_COUNT clusters..."
done
echo "✅ All deletions complete"
echo ""
fi
# Delete remaining failed clusters
if [ "$FAILED_COUNT" -gt 0 ]; then
echo "Deleting remaining failed clusters..."
az aks list --subscription "$SUBSCRIPTION_ID" \
--query "[?contains(name, 'az-p-') && provisioningState == 'Failed'].{name:name, rg:resourceGroup}" -o json | \
jq -r '.[] | "\(.rg)|\(.name)"' | while IFS='|' read -r rg name; do
echo "Deleting: $name"
az aks delete --resource-group "$rg" --name "$name" --subscription "$SUBSCRIPTION_ID" --yes --no-wait 2>&1 | grep -v "^$" || true
done
echo "✅ Deletion initiated for failed clusters"
echo ""
fi
# Delete remaining canceled clusters
if [ "$CANCELED_COUNT" -gt 0 ]; then
echo "Deleting remaining canceled clusters..."
az aks list --subscription "$SUBSCRIPTION_ID" \
--query "[?contains(name, 'az-p-') && provisioningState == 'Canceled'].{name:name, rg:resourceGroup}" -o json | \
jq -r '.[] | "\(.rg)|\(.name)"' | while IFS='|' read -r rg name; do
echo "Deleting: $name"
az aks delete --resource-group "$rg" --name "$name" --subscription "$SUBSCRIPTION_ID" --yes --no-wait 2>&1 | grep -v "^$" || true
done
echo "✅ Deletion initiated for canceled clusters"
echo ""
fi
echo "Waiting 60 seconds for deletions to process..."
sleep 60
echo ""
echo "=== Re-running Terraform Deployment ==="
echo ""
cd "$TERRAFORM_DIR"
echo "Initializing Terraform..."
terraform init -upgrade >/dev/null 2>&1 || true
echo ""
echo "Applying Terraform configuration..."
echo "This will recreate all deleted clusters"
echo ""
terraform apply -parallelism=128 -auto-approve 2>&1 | tee /tmp/terraform-apply-continued.log
echo ""
echo "✅ Fix process complete!"