1
0
Fork 0
mirror of https://github.com/arangodb/kube-arangodb.git synced 2024-12-14 11:57:37 +00:00
kube-arangodb/scripts/patch_chart.sh
2024-09-11 10:12:52 +02:00

25 lines
No EOL
857 B
Bash
Executable file

#!/bin/bash
# Updates the versions in helm charts to reflect the current
# version.
VERSION=$1
if [ -z $VERSION ]; then
echo "Specify a version argument"
exit 1
fi
function replaceInFile {
local EXPR=$1
local FILE=$2
sed -i --expression "${EXPR}" ${FILE}
}
for f in kube-arangodb kube-arangodb-enterprise kube-arangodb-arm64 kube-arangodb-enterprise-arm64 kube-arangodb-crd; do
replaceInFile "s@^version: .*\$@version: ${VERSION}@g" "chart/${f}/Chart.yaml"
if [[ -f "chart/${f}/values.yaml" ]]; then
replaceInFile "s@^ image: arangodb/kube-arangodb:[[:digit:]].*\$@ image: arangodb/kube-arangodb:${VERSION}@g" "chart/${f}/values.yaml"
replaceInFile "s@^ image: arangodb/kube-arangodb-enterprise:[[:digit:]].*\$@ image: arangodb/kube-arangodb-enterprise:${VERSION}@g" "chart/${f}/values.yaml"
fi
done