Skip to content

Instantly share code, notes, and snippets.

@carlosjgp
Created March 23, 2023 14:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save carlosjgp/091c588a8bad0f4ce3e1004cf9491f8c to your computer and use it in GitHub Desktop.
Save carlosjgp/091c588a8bad0f4ce3e1004cf9491f8c to your computer and use it in GitHub Desktop.
Helm chart testing
#!/bin/bash
set -ex
helm repo up
# Find `ci` directories
for chart_file in $(find * -name Chart.yaml -print | sort); do
# Find `.template` files
dir=$(dirname ${chart_file})
if [ -d "${dir}/ci" ]; then
examples_dir="${dir}/examples"
rm -rf ${examples_dir}
mkdir -p ${examples_dir}
for file in $(find ${dir}/ci -name "*-values.yaml" -type f); do
# Render chart
example_filename=$(basename ${file})
helm dep build ${dir} --skip-refresh
helm template ${dir} --values ${file} > "${examples_dir}/${example_filename}"
done
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment