Created
March 23, 2023 14:45
-
-
Save carlosjgp/091c588a8bad0f4ce3e1004cf9491f8c to your computer and use it in GitHub Desktop.
Helm chart testing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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