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.
This commit is contained in:
36
scripts/lib/config/env.sh
Executable file
36
scripts/lib/config/env.sh
Executable file
@@ -0,0 +1,36 @@
|
||||
#!/usr/bin/env bash
|
||||
# Environment configuration loader
|
||||
# Usage: source "$SCRIPT_DIR/lib/config/env.sh"
|
||||
|
||||
# Source paths if not already sourced
|
||||
[ -z "${PROJECT_ROOT:-}" ] && source "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/../common/paths.sh"
|
||||
|
||||
# Default subscription ID
|
||||
DEFAULT_SUBSCRIPTION_ID="${DEFAULT_SUBSCRIPTION_ID:-fc08d829-4f14-413d-ab27-ce024425db0b}"
|
||||
|
||||
# Load environment variables from .env file
|
||||
load_env() {
|
||||
local env_file="${1:-${PROJECT_ROOT}/.env}"
|
||||
|
||||
if [ -f "$env_file" ]; then
|
||||
# Export variables, ignoring comments and empty lines
|
||||
set -a
|
||||
source <(grep -v '^#' "$env_file" | grep -v '^$' | sed 's/^/export /')
|
||||
set +a
|
||||
fi
|
||||
}
|
||||
|
||||
# Get Azure subscription ID
|
||||
get_subscription_id() {
|
||||
echo "${AZURE_SUBSCRIPTION_ID:-${DEFAULT_SUBSCRIPTION_ID}}"
|
||||
}
|
||||
|
||||
# Set Azure subscription
|
||||
set_subscription() {
|
||||
local subscription_id="${1:-$(get_subscription_id)}"
|
||||
az account set --subscription "$subscription_id" &> /dev/null || return 1
|
||||
}
|
||||
|
||||
# Auto-load env if PROJECT_ROOT is set
|
||||
[ -n "${PROJECT_ROOT:-}" ] && load_env
|
||||
|
||||
121
scripts/lib/config/regions.sh
Executable file
121
scripts/lib/config/regions.sh
Executable file
@@ -0,0 +1,121 @@
|
||||
#!/usr/bin/env bash
|
||||
# Region code mapping - Single source of truth
|
||||
# All region codes are standardized to exactly 3 characters
|
||||
# Usage: source "$SCRIPT_DIR/lib/config/regions.sh"
|
||||
|
||||
# Region codes mapping (standardized to exactly 3 characters)
|
||||
declare -A REGION_CODES=(
|
||||
["northeurope"]="nor"
|
||||
["uksouth"]="uks"
|
||||
["ukwest"]="ukw"
|
||||
["westeurope"]="wst"
|
||||
["francecentral"]="frc"
|
||||
["germanywestcentral"]="gwc"
|
||||
["switzerlandnorth"]="swn"
|
||||
["switzerlandwest"]="swt"
|
||||
["swedencentral"]="swc"
|
||||
["norwayeast"]="noe"
|
||||
["polandcentral"]="pol"
|
||||
["spaincentral"]="spa"
|
||||
["italynorth"]="ita"
|
||||
["southindia"]="sin"
|
||||
["centralindia"]="cin"
|
||||
["westindia"]="win"
|
||||
["belgiumcentral"]="bel"
|
||||
["eastasia"]="eas"
|
||||
["southeastasia"]="sea"
|
||||
["japaneast"]="jpe"
|
||||
["japanwest"]="jpw"
|
||||
["koreacentral"]="kor"
|
||||
["koreasouth"]="kos"
|
||||
["australiaeast"]="aus"
|
||||
["australiasoutheast"]="ase"
|
||||
["newzealandnorth"]="nzl"
|
||||
["indonesiacentral"]="idn"
|
||||
["malaysiawest"]="mys"
|
||||
["uaenorth"]="uae"
|
||||
["qatarcentral"]="qat"
|
||||
["israelcentral"]="ilc"
|
||||
["canadacentral"]="can"
|
||||
["canadaeast"]="cae"
|
||||
["brazilsouth"]="bra"
|
||||
["chilecentral"]="chl"
|
||||
["mexicocentral"]="mex"
|
||||
["southafricanorth"]="zaf"
|
||||
["austriaeast"]="aut"
|
||||
)
|
||||
|
||||
# Reverse mapping (code -> region name)
|
||||
declare -A REGION_CODE_TO_NAME=()
|
||||
for region_name in "${!REGION_CODES[@]}"; do
|
||||
REGION_CODE_TO_NAME["${REGION_CODES[$region_name]}"]="$region_name"
|
||||
done
|
||||
|
||||
# Old code mappings (for backward compatibility with existing resources)
|
||||
declare -A OLD_CODE_TO_REGION=(
|
||||
["ne"]="northeurope"
|
||||
["we"]="westeurope"
|
||||
["fc"]="francecentral"
|
||||
["sn"]="switzerlandnorth"
|
||||
["sw"]="switzerlandwest"
|
||||
["in"]="italynorth"
|
||||
["pc"]="polandcentral"
|
||||
["sc"]="spaincentral"
|
||||
["bc"]="belgiumcentral"
|
||||
["ae"]="australiaeast" # Note: conflicts with austriaeast (old), prefer australiaeast
|
||||
["ea"]="eastasia"
|
||||
["ci"]="centralindia"
|
||||
["si"]="southindia"
|
||||
["wi"]="westindia"
|
||||
["je"]="japaneast"
|
||||
["jw"]="japanwest"
|
||||
["kc"]="koreacentral"
|
||||
["ks"]="koreasouth"
|
||||
["cc"]="canadacentral"
|
||||
["ce"]="canadaeast"
|
||||
["bs"]="brazilsouth"
|
||||
["mc"]="mexicocentral"
|
||||
["qc"]="qatarcentral"
|
||||
["ic"]="indonesiacentral"
|
||||
["mw"]="malaysiawest"
|
||||
["nzn"]="newzealandnorth"
|
||||
["san"]="southafricanorth"
|
||||
["uan"]="uaenorth"
|
||||
["chc"]="chilecentral"
|
||||
)
|
||||
|
||||
# Get all regions as array (region_name:code format)
|
||||
get_all_regions() {
|
||||
for region_name in "${!REGION_CODES[@]}"; do
|
||||
echo "${region_name}:${REGION_CODES[$region_name]}"
|
||||
done | sort
|
||||
}
|
||||
|
||||
# Get region code by region name
|
||||
get_region_code() {
|
||||
local region_name="$1"
|
||||
echo "${REGION_CODES[$region_name]:-}"
|
||||
}
|
||||
|
||||
# Get region name by code (tries new codes first, then old codes)
|
||||
get_region_name() {
|
||||
local code="$1"
|
||||
# Try new codes first
|
||||
if [ -n "${REGION_CODE_TO_NAME[$code]:-}" ]; then
|
||||
echo "${REGION_CODE_TO_NAME[$code]}"
|
||||
return 0
|
||||
fi
|
||||
# Try old codes for backward compatibility
|
||||
if [ -n "${OLD_CODE_TO_REGION[$code]:-}" ]; then
|
||||
echo "${OLD_CODE_TO_REGION[$code]}"
|
||||
return 0
|
||||
fi
|
||||
return 1
|
||||
}
|
||||
|
||||
# Validate region code (must be 3 characters)
|
||||
is_valid_region_code() {
|
||||
local code="$1"
|
||||
[[ "$code" =~ ^[a-z]{3}$ ]] && [ -n "${REGION_CODE_TO_NAME[$code]:-}" ]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user