Skip to content

Commit

Permalink
ensure example versions are updated (#5853)
Browse files Browse the repository at this point in the history
  • Loading branch information
pdabelf5 authored Jun 25, 2024
1 parent 1196c8c commit e7f4885
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions .github/scripts/release-version-update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ ROOTDIR=$(git rev-parse --show-toplevel || echo ".")
TMPDIR=/tmp
HELM_CHART_PATH="${ROOTDIR}/charts/nginx-ingress"
DEPLOYMENT_PATH="${ROOTDIR}/deployments"
EXAMPLES_PATH="${ROOTDIR}/examples"
DEBUG=${DEBUG:-"false"}

DOCS_TO_UPDATE_FOLDER=${ROOTDIR}/docs/content
Expand Down Expand Up @@ -120,3 +121,19 @@ for i in ${docs_files}; do
exit 2
fi
done

# update examples with new versions
example_files=$(find "${EXAMPLES_PATH}" -type f -name "*.md")
for i in ${example_files}; do
if [ "${DEBUG}" != "false" ]; then
echo "Processing ${i}"
fi
file_name=$(basename "${i}")
mv "${i}" "${TMPDIR}/${file_name}"
cat "${TMPDIR}/${file_name}" | sed -e "$regex_ic" | sed -e "$regex_helm" > "${i}"
if [ $? -ne 0 ]; then
echo "ERROR: failed processing ${i}"
mv "${TMPDIR}/${file_name}" "${i}"
exit 2
fi
done

0 comments on commit e7f4885

Please sign in to comment.