@@ -23,8 +23,39 @@ website() {
23
23
find website/content/en/${RELEASE_VERSION} /* /* /* .yaml -type f | xargs perl -i -p -e " s/preview/${RELEASE_VERSION} /g;"
24
24
}
25
25
26
+ editWebsiteConfig () {
27
+ sed -i ' ' ' /^\/docs\/\*/d' website/static/_redirects
28
+ echo " /docs/* /${RELEASE_VERSION} /:splat" >> website/static/_redirects
29
+
30
+ yq -i " .params.latest_release_version = \" ${RELEASE_VERSION} \" " website/config.yaml
31
+ yq -i " .menu.main[] |=select(.name == \" Docs\" ) .url = \" ${RELEASE_VERSION} \" " website/config.yaml
32
+
33
+ editWebsiteVersionsMenu
34
+ }
35
+
36
+ # editWebsiteVersionsMenu sets relevant releases in the version dropdown menu of the website
37
+ # without increasing the size of the set.
38
+ # TODO: We need to maintain a list of latest minors here only. This is not currently
39
+ # easy to achieve, however when we have a major release and we decide to maintain
40
+ # a selected minor releases we can maintain that list in the repo and use it in here
41
+ editWebsiteVersionsMenu () {
42
+ VERSIONS=(${RELEASE_VERSION} )
43
+ while IFS= read -r LINE; do
44
+ SANITIZED_VERSION=$( echo " ${LINE} " | sed -e ' s/["-]//g' -e ' s/ *//g' )
45
+ VERSIONS+=(" ${SANITIZED_VERSION} " )
46
+ done < <( yq ' .params.versions' website/config.yaml)
47
+ unset VERSIONS[${# VERSIONS[@]} -2]
48
+
49
+ yq -i ' .params.versions = []' website/config.yaml
50
+
51
+ for VERSION in " ${VERSIONS[@]} " ; do
52
+ yq -i " .params.versions += \" ${VERSION} \" " website/config.yaml
53
+ done
54
+ }
55
+
26
56
authenticate
27
57
buildImages $RELEASE_VERSION
28
58
cosignImages
29
59
chart
30
60
website
61
+ editWebsiteConfig
0 commit comments