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_examples.sh
2023-07-03 10:05:56 +02:00

27 lines
No EOL
833 B
Bash
Executable file

#!/bin/bash
# Updates examples to match current version.
VERSION=$1
if [ -z $VERSION ]; then
echo "Specify a version argument"
exit 1
fi
ARANGODB_VERSION=3.10.8
function replaceInFile {
local EXPR=$1
local FILE=$2
sed -E -i --expression "${EXPR}" ${FILE}
}
FILES=$(find ./examples -type f -name '*.yaml')
for FILE in ${FILES}; do
replaceInFile "s@arangodb/arangodb:[0-9]+\\.[0-9]+\\.[0-9]+@arangodb/arangodb:${ARANGODB_VERSION}@g" ${FILE}
replaceInFile "s@arangodb/enterprise:[0-9]+\\.[0-9]+\\.[0-9]+@arangodb/enterprise:${ARANGODB_VERSION}@g" ${FILE}
replaceInFile "s@arangodb/kube-arangodb:[0-9]+\\.[0-9]+\\.[0-9]+@arangodb/kube-arangodb:${VERSION}@g" ${FILE}
replaceInFile "s@arangodb/kube-arangodb-enterprise:[0-9]+\\.[0-9]+\\.[0-9]+@arangodb/kube-arangodb-enterprise:${VERSION}@g" ${FILE}
done