Files
italiadatacenter/pipeline/deploy.sh
T
2026-09-21 10:00:05 +02:00

31 lines
951 B
Bash

#!/bin/bash
set -euo pipefail
# Esegue kubectl apply per ogni sottodirectory di kubernetes separatamente
ENVIRONMENT="${1:-dev}"
YAML_DIR="kubernetes"
# ---------------------------------------------------------------------------
# Deploy di tutti i manifest 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
echo "Deploy delle risorse di monitoring nella directory $DIR con kubeconfig dedicato..."
kubectl --kubeconfig=/root/work/pipeline/kc apply -f "$DIR"
else
echo "Deploy delle risorse nella directory $DIR..."
kubectl --kubeconfig=./kubeconfig apply -f "$DIR"
fi
fi
done
echo "Deploy completato di tutte le directory YAML."
echo "Eseguo check su endpoint da pubblicare"
/root/work/pipeline/addlistener.sh "$ENVIRONMENT"