Files
helm-charts-hardened/helm-docs.sh
T
Marco FranssenandFaisal Memon 65312f8525 Include dependency values in documentation (#275)
I have added a flag to the helm-docs script to include the documentation
for dependencies.

This will add more complete documentation to
https://artifacthub.io/packages/helm/spiffe/spire#values so it is easier
for our users to get started and having a complete overview.

---------

Signed-off-by: Marco Franssen <[email protected]>
Co-authored-by: Faisal Memon <[email protected]>
2023-05-12 18:12:23 +00:00

47 lines
1.3 KiB
Bash
Executable File

#!/usr/bin/env bash
set -euo pipefail
SCRIPTPATH=$(dirname "$0")
HELM_DOCS_VERSION="1.11.0"
case "$(uname -s)" in
Linux*)
machine=Linux
shasum=sha256sum
exe=helm-docs
;;
Darwin*)
machine=Darwin
shasum=shasum
exe=helm-docs
;;
MINGW64*)
machine=Windows
shasum=sha256sum
exe=helm-docs.exe
;;
esac
function install_helm_docs {
curl -LO "https://github.com/norwoodj/helm-docs/releases/download/v${HELM_DOCS_VERSION}/helm-docs_${HELM_DOCS_VERSION}_${machine}_x86_64.tar.gz"
curl -L --output /tmp/checksums_helm-docs.txt "https://github.com/norwoodj/helm-docs/releases/download/v${HELM_DOCS_VERSION}/checksums.txt"
grep "helm-docs_${HELM_DOCS_VERSION}_${machine}_x86_64.tar.gz" /tmp/checksums_helm-docs.txt | $shasum -c -
mkdir -p "$SCRIPTPATH/bin"
tar -xf "helm-docs_${HELM_DOCS_VERSION}_${machine}_x86_64.tar.gz" "${exe}"
mv "${exe}" "$SCRIPTPATH/bin/"
rm "helm-docs_${HELM_DOCS_VERSION}_${machine}_x86_64.tar.gz"
}
if [ ! -f "$SCRIPTPATH/bin/${exe}" ] ; then
install_helm_docs
elif [[ ! "$("$SCRIPTPATH/bin/${exe}" --version)" =~ .*"$HELM_DOCS_VERSION".* ]] ; then
install_helm_docs
else
echo "Using '$("$SCRIPTPATH/bin/${exe}" --version)'"
fi
# validate docs
"$SCRIPTPATH/bin/${exe}" --document-dependency-values
git diff --exit-code