-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Split docs script cherry pick (#5090)
* Split version update script (#4961) * Bump nginx from `156d75f` to `f2802c2` in /build (#5072) * Bump redhat/ubi8 from `23d8dfd` to `627867e` in /build (#5073) * Bump opentracing/nginx-opentracing from `2e0268d` to `2217e9f` in /build (#5074)
- Loading branch information
Showing
5 changed files
with
76 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -o pipefail | ||
|
||
ROOTDIR=$(git rev-parse --show-toplevel || echo ".") | ||
TMPDIR=/tmp | ||
DEBUG=${DEBUG:-"false"} | ||
|
||
DOCS_TO_UPDATE_FOLDER=${ROOTDIR}/docs/content | ||
|
||
usage() { | ||
echo "Usage: $0 <ic_version> <helm_chart_version> <k8s_versions> <release_date>" | ||
exit 1 | ||
} | ||
|
||
ic_version=$1 | ||
helm_chart_version=$2 | ||
k8s_versions=$3 | ||
release_date=$4 | ||
|
||
if [ -z "${ic_version}" ]; then | ||
usage | ||
fi | ||
|
||
if [ -z "${helm_chart_version}" ]; then | ||
usage | ||
fi | ||
|
||
if [ -z "${k8s_versions}" ]; then | ||
usage | ||
fi | ||
|
||
if [ -z "${release_date}" ]; then | ||
usage | ||
fi | ||
|
||
# update releases docs | ||
file_path=${DOCS_TO_UPDATE_FOLDER}/releases.md | ||
if [ "${DEBUG}" != "false" ]; then | ||
echo "Processing ${file_path}" | ||
fi | ||
file_name=$(basename "${file_path}") | ||
mv "${file_path}" "${TMPDIR}/${file_name}" | ||
sed -e "8r ${ROOTDIR}/hack/changelog-template.txt" "${TMPDIR}/${file_name}" | sed \ | ||
-e "s/%%TITLE%%/## $ic_version/g" \ | ||
-e "s/%%IC_VERSION%%/$ic_version/g" \ | ||
-e "s/%%HELM_CHART_VERSION%%/$helm_chart_version/g" \ | ||
-e "s/%%K8S_VERSIONS%%/$k8s_versions.\n/g" \ | ||
-e "s/%%RELEASE_DATE%%/$release_date/g" \ | ||
> ${file_path} | ||
if [ $? -ne 0 ]; then | ||
echo "ERROR: failed processing ${file_path}" | ||
mv "${TMPDIR}/${file_name}" "${file_path}" | ||
exit 2 | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters