Skip to content

Commit e7f4885

Browse files
authored
ensure example versions are updated (#5853)
1 parent 1196c8c commit e7f4885

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

.github/scripts/release-version-update.sh

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ ROOTDIR=$(git rev-parse --show-toplevel || echo ".")
66
TMPDIR=/tmp
77
HELM_CHART_PATH="${ROOTDIR}/charts/nginx-ingress"
88
DEPLOYMENT_PATH="${ROOTDIR}/deployments"
9+
EXAMPLES_PATH="${ROOTDIR}/examples"
910
DEBUG=${DEBUG:-"false"}
1011

1112
DOCS_TO_UPDATE_FOLDER=${ROOTDIR}/docs/content
@@ -120,3 +121,19 @@ for i in ${docs_files}; do
120121
exit 2
121122
fi
122123
done
124+
125+
# update examples with new versions
126+
example_files=$(find "${EXAMPLES_PATH}" -type f -name "*.md")
127+
for i in ${example_files}; do
128+
if [ "${DEBUG}" != "false" ]; then
129+
echo "Processing ${i}"
130+
fi
131+
file_name=$(basename "${i}")
132+
mv "${i}" "${TMPDIR}/${file_name}"
133+
cat "${TMPDIR}/${file_name}" | sed -e "$regex_ic" | sed -e "$regex_helm" > "${i}"
134+
if [ $? -ne 0 ]; then
135+
echo "ERROR: failed processing ${i}"
136+
mv "${TMPDIR}/${file_name}" "${i}"
137+
exit 2
138+
fi
139+
done

0 commit comments

Comments
 (0)