Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

makefile target for helm templating charts #1660

Merged
merged 1 commit into from
Jul 13, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -416,3 +416,11 @@ kind-restart-%: .local/kind-kubeconfig
kubectl delete pod -n $(NAMESPACE) -l wireService=$(*) && \
kubectl delete pod -n $(NAMESPACE)-fed2 -l wireService=$(*)

# This target can be used to template a helm chart with values filled in from
# 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 $(*)

24 changes: 24 additions & 0 deletions hack/bin/helm-template.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/usr/bin/env bash

# This script can be used to template a helm chart 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

chart=${1:?$USAGE}

DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
TOP_LEVEL="$DIR/../.."
CHARTS_DIR="${TOP_LEVEL}/.local/charts"

valuesfile="${DIR}/../helm_vars/${chart}/values.yaml"
declare -a options=()
if [ -f "$valuesfile" ]; then
options+=(-f "$valuesfile")
fi

"$DIR/update.sh" "$CHARTS_DIR/$chart"
helm template $"chart" "$CHARTS_DIR/$chart" ${options[*]}