Migrate all repos into monorepo context folders
Bahn: aisupport, Analyse-O2C-C2S, awesome-bahn-mcp-servers, beam-mcp,
Confluence_Bot, db-planet-mcp-server, O2C-Harness, project-audit,
Projekt-KIQ-HP, teamlandkarte-mcp
Dhive: Jury-Voting
Privat: CV, NoteGraph (NOTE: NoteGraph needs complete redo after consolidation)
Shared: AI-Orchestrator, OrgMyLife, power_skills_and_more
Shared/references: symphony (read-only)
Bahn repos remain available as independent remotes - this monorepo
pulls them in via subtree, the originals are untouched.
This commit is contained in:
@@ -0,0 +1,105 @@
|
||||
#!/bin/bash
|
||||
# Deployment script for DB Planet MCP Server
|
||||
# Usage: ./infra/deploy.sh --environment DEV|IAT|Prod [--image-tag TAG]
|
||||
|
||||
set -e
|
||||
|
||||
ENVIRONMENT=""
|
||||
IMAGE_TAG=""
|
||||
LOCATION="westeurope"
|
||||
|
||||
while [[ $# -gt 0 ]]; do
|
||||
case $1 in
|
||||
-e|--environment) ENVIRONMENT="$2"; shift 2 ;;
|
||||
-t|--image-tag) IMAGE_TAG="$2"; shift 2 ;;
|
||||
-h|--help)
|
||||
echo "Usage: $0 -e ENV [-t IMAGE_TAG]"
|
||||
echo " -e, --environment DEV, IAT, or Prod"
|
||||
echo " -t, --image-tag Container image tag (optional, uses param file default)"
|
||||
exit 0 ;;
|
||||
*) echo "Unknown option: $1"; exit 1 ;;
|
||||
esac
|
||||
done
|
||||
|
||||
if [[ ! "$ENVIRONMENT" =~ ^(DEV|IAT|Prod)$ ]]; then
|
||||
echo "❌ Environment must be DEV, IAT, or Prod"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
ENV_LOWER=$(echo "$ENVIRONMENT" | tr '[:upper:]' '[:lower:]')
|
||||
PARAM_FILE="infra/parameters/${ENV_LOWER}.bicepparam"
|
||||
|
||||
if [[ ! -f "$PARAM_FILE" ]]; then
|
||||
echo "❌ Parameter file not found: $PARAM_FILE"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "🚀 Deploying DB Planet MCP Server — $ENVIRONMENT"
|
||||
echo " Parameter file: $PARAM_FILE"
|
||||
[[ -n "$IMAGE_TAG" ]] && echo " Image tag: $IMAGE_TAG"
|
||||
echo ""
|
||||
|
||||
# Step 1: Deploy infrastructure (RG, Identity, Key Vault, App Insights, RBAC)
|
||||
DEPLOY_NAME="dbplanet-mcp-${ENV_LOWER}-$(date +%Y%m%d-%H%M%S)"
|
||||
echo "� Step 1: Deploying infrastructure..."
|
||||
|
||||
if ! az deployment sub create \
|
||||
--location "$LOCATION" \
|
||||
--parameters "$PARAM_FILE" \
|
||||
--name "$DEPLOY_NAME"; then
|
||||
echo "❌ Infrastructure deployment failed"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "✅ Infrastructure deployed"
|
||||
echo ""
|
||||
|
||||
# Step 2: Deploy Container App
|
||||
echo "📦 Step 2: Deploying Container App..."
|
||||
|
||||
DEPLOY_ARGS=("--location" "$LOCATION" "--parameters" "$PARAM_FILE"
|
||||
"--parameters" "deployContainerApp=true"
|
||||
"--name" "${DEPLOY_NAME}-app")
|
||||
|
||||
[[ -n "$IMAGE_TAG" ]] && DEPLOY_ARGS+=("--parameters" "imageTag=$IMAGE_TAG")
|
||||
|
||||
if ! az deployment sub create "${DEPLOY_ARGS[@]}"; then
|
||||
echo "❌ Container App deployment failed"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "✅ Container App deployed"
|
||||
echo ""
|
||||
|
||||
# Step 3: Verify
|
||||
echo "🔍 Step 3: Verifying deployment..."
|
||||
|
||||
CA_NAME=$(az deployment sub show --name "${DEPLOY_NAME}-app" \
|
||||
--query "properties.outputs.containerAppName.value" -o tsv)
|
||||
CA_FQDN=$(az deployment sub show --name "${DEPLOY_NAME}-app" \
|
||||
--query "properties.outputs.containerAppFqdn.value" -o tsv)
|
||||
|
||||
echo " Container App: $CA_NAME"
|
||||
echo " FQDN: $CA_FQDN"
|
||||
|
||||
# Wait for healthy revision
|
||||
RG_NAME="rg-dbplanet-mcp-${ENV_LOWER}"
|
||||
for i in $(seq 1 10); do
|
||||
STATE=$(az containerapp revision list --name "$CA_NAME" \
|
||||
--resource-group "$RG_NAME" \
|
||||
--query "[?properties.active].properties.runningState | [0]" -o tsv 2>/dev/null)
|
||||
if [[ "$STATE" == "Running" || "$STATE" == "RunningAtMaxScale" ]]; then
|
||||
echo " ✅ Revision is Running + Healthy"
|
||||
break
|
||||
fi
|
||||
echo " ⏳ Waiting for revision ($STATE)... ($i/10)"
|
||||
if [[ "$i" -eq 10 ]]; then
|
||||
echo " ❌ Revision did not reach Running state after 10 attempts"
|
||||
exit 1
|
||||
fi
|
||||
sleep 15
|
||||
done
|
||||
|
||||
echo ""
|
||||
echo "🎉 Deployment complete!"
|
||||
echo " Health: https://${CA_FQDN}/health"
|
||||
Reference in New Issue
Block a user