This commit is contained in:
alessandro barucci
2026-10-11 23:49:35 +02:00
parent 23f276417f
commit 34213918fe
32 changed files with 1411 additions and 9 deletions
+6
View File
@@ -7,6 +7,8 @@ ENVIRONMENT="${1:-dev}"
YAML_DIR="kubernetes"
# Valore di alert_notification_email per l'ambiente (ultima occorrenza in env/<env>/*.env)
ALERT_EMAIL=$(cat "env/$ENVIRONMENT"/*.env 2>/dev/null | grep -E '^[[:space:]]*alert_notification_email[[:space:]]*=' | tail -n 1 | sed -E 's/^[^=]*=//' | tr -d '\r"'"'"'[:space:]' || true)
# ---------------------------------------------------------------------------
@@ -15,6 +17,10 @@ YAML_DIR="kubernetes"
find "$YAML_DIR" -type d | while read DIR; do
if ls "$DIR"/*.yaml 1> /dev/null 2>&1; then
if [ "$(basename "$DIR")" = "monitoring" ]; then
if [ -z "$ALERT_EMAIL" ]; then
echo "alert_notification_email non valorizzata per l'ambiente $ENVIRONMENT: deploy di $DIR saltato."
continue
fi
echo "Deploy delle risorse di monitoring nella directory $DIR con kubeconfig dedicato..."
kubectl --kubeconfig=/root/work/pipeline/kc apply -f "$DIR"
else