diff --git a/Makefile b/Makefile index 4ea6e2e0e7..07aa30c68d 100644 --- a/Makefile +++ b/Makefile @@ -522,7 +522,7 @@ kind-restart-%: .local/kind-kubeconfig # hack/helm_vars (what CI uses) as overrrides, if available. This allows debugging helm # templating issues without actually installing anything, and without needing # access to a kubernetes cluster. e.g.: -# make helm-template-wire-server -helm-template-%: clean-charts charts-integration - ./hack/bin/helm-template.sh $(*) +# make helm-template +helm-template: clean-charts charts-integration + ./hack/bin/helm-template.sh diff --git a/changelog.d/5-internal/helmfile-template b/changelog.d/5-internal/helmfile-template new file mode 100644 index 0000000000..36eb119a54 --- /dev/null +++ b/changelog.d/5-internal/helmfile-template @@ -0,0 +1 @@ +Make the helm-template script use helmfile diff --git a/hack/bin/helm-template.sh b/hack/bin/helm-template.sh index d72684ce9b..cae6ed599a 100755 --- a/hack/bin/helm-template.sh +++ b/hack/bin/helm-template.sh @@ -1,28 +1,28 @@ #!/usr/bin/env bash -# This script can be used to template a helm chart with values filled in from +# This script can be used to render all helm charts with values filled in from # hack/helm_vars as overrrides, if available. This allows debugging helm # templating issues without actually installing anything, and without needing # access to a kubernetes cluster -USAGE="Usage: $0" -set -e +# Call the script directly (optionally with `--skip-deps`), or via the +# `helm-template` make target. -chart=${1:?$USAGE} +set -e DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" TOP_LEVEL="$DIR/../.." CHARTS_DIR="${TOP_LEVEL}/.local/charts" +: "${FEDERATION_DOMAIN_BASE:=example.com}" +: "${FEDERATION_DOMAIN:=namespace1.example.com}" +: "${NAMESPACE:=namespace1}" -valuesfile="${DIR}/../helm_vars/${chart}/values.yaml" -certificatesfile="${DIR}/../helm_vars/${chart}/certificates.yaml" -declare -a options=() -if [ -f "$valuesfile" ]; then - options+=(-f "$valuesfile") -fi -if [ -f "$certificatesfile" ]; then - options+=(-f "$certificatesfile") +export FEDERATION_DOMAIN_BASE +export FEDERATION_DOMAIN +export NAMESPACE + +if [ ! -f "$DIR/../helm_vars/wire-server/certificates-namespace1.yaml" ]; then + "$DIR/selfsigned-kubernetes.sh" namespace1 fi -"$DIR/update.sh" "$CHARTS_DIR/$chart" -helm template $"chart" "$CHARTS_DIR/$chart" ${options[*]} +helmfile -f "$DIR/../helmfile-single.yaml" template "$@"