diff --git a/infra/ocm-chart/deploy-all.sh b/infra/ocm-chart/deploy-all.sh index 4aabd576916037bb6bb34f2d179d5d529e400f2f..d33b5c536bc1230482cf2976a69a2636355ff964 100644 --- a/infra/ocm-chart/deploy-all.sh +++ b/infra/ocm-chart/deploy-all.sh @@ -1 +1,29 @@ -helm install ocm-instance1 mychart/ -f ocm1-values.yaml +#!/bin/bash + +# Path to the Helm chart +CHART_PATH="." + +# Get a list of all values-*.yaml files in the current directory +VALUES_FILES=$(ls values*.yaml) + +# Loop over each values file +for VALUES_FILE in $VALUES_FILES +do + # Extract the base name without extension + BASE_NAME=$(basename "$VALUES_FILE" .yaml) + + # Use the base name as the release name + RELEASE_NAME="ocm_$BASE_NAME" + + # Run helm install with the found values file + echo "Deploying $RELEASE_NAME with $VALUES_FILE" + helm install "$RELEASE_NAME" "$CHART_PATH" -f "./$VALUES_FILE" + + # Check for errors + if [ $? -ne 0 ]; then + echo "Helm install failed for $VALUES_FILE" + exit 1 + fi +done + +echo "Helm install completed for all values files."