Skip to content

Instantly share code, notes, and snippets.

@tun0
Created September 25, 2019 10:28
Show Gist options
  • Save tun0/845e796008ac6ca6229af910682c6983 to your computer and use it in GitHub Desktop.
Save tun0/845e796008ac6ca6229af910682c6983 to your computer and use it in GitHub Desktop.
#!/bin/sh
CHART=$1
HR=$2
usage() {
echo "$(basename $0) </path/to/chart/> </path/to/helmrelease>"
}
if test ! -d "${CHART}"
then
echo "Error! \"${CHART}\" is not an existing directory!"
echo
usage
exit 1;
fi
if test ! -f "${HR}"
then
echo "Error! \"${HR}\" is not an existing file!"
echo
usage
exit 1;
fi
NAME=$(yq r ${HR} metadata.name)
VALUES=$(yq r ${HR} spec.values)
echo "${VALUES}" | helm install --debug --dry-run --name ${NAME} --values=- ${CHART}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment