@@ -87,13 +87,17 @@ jobs:
8787 rm -r "content/operate/kubernetes/${version_to_remove}"
8888 done
8989
90- cp -r "content/operate/kubernetes/${version}"/* content/operate/kubernetes/
91- rm -r "content/operate/kubernetes/${version}"
90+ # relrefs should not include version
91+ find "content/operate/kubernetes/${version}" -type f | while read file; do
92+ awk '{gsub(/\(\{\{< ?relref "\/operate\/kubernetes\/'${version}'/, "({{< relref \"/operate/kubernetes") }1' "$file" > tmpfile && mv tmpfile "$file"
93+ done
94+
95+ rsync -a --delete-after "content/operate/kubernetes/${version}"/ content/operate/kubernetes/
9296 sed -i 's/id="versionSelectorKubernetesValue" class="version-selector-control">latest/id="versionSelectorKubernetesValue" class="version-selector-control">v'"${version}"'/' layouts/partials/docs-nav.html
9397 sed -i 's/linkTitle: '"${version}"'/linkTitle: Redis for Kubernetes/' content/operate/kubernetes/_index.md
9498
9599 # inject replace command in meta-links to make sure editURL and issuesURL point to right version
96- sed -i "12i \{\{ \$gh_file = replaceRE \`\^operate\/kubernetes\/\` \"operate\/kubernetes\/$version\/\" \$gh_file }}" layouts/partials/meta-links.html
100+ sed -i "12i \{\{ \$gh_path = replaceRE \`\^operate\/kubernetes\/\` \"operate\/kubernetes\/$version\/\" \$gh_path }}" layouts/partials/meta-links.html
97101
98102 hugo -d "kubernetes-${version}"
99103
@@ -110,13 +114,17 @@ jobs:
110114 rm -r "content/operate/rs/${version_to_remove}"
111115 done
112116
113- cp -r "content/operate/rs/${version}"/* content/operate/rs/
114- rm -r "content/operate/rs/${version}"
117+ # relrefs should not include version
118+ find "content/operate/rs/${version}" -type f | while read file; do
119+ awk '{gsub(/\(\{\{< ?relref "\/operate\/rs\/'${version}'/, "({{< relref \"/operate/rs") }1' "$file" > tmpfile && mv tmpfile "$file"
120+ done
121+
122+ rsync -a --delete-after "content/operate/rs/${version}"/ content/operate/rs/
115123 sed -i 's/id="versionSelectorRsValue" class="version-selector-control">latest/id="versionSelectorRsValue" class="version-selector-control">v'"${version}"'/' layouts/partials/docs-nav.html
116124 sed -i 's/linkTitle: '"${version}"'/linkTitle: Redis Software/' content/operate/rs/_index.md
117125
118126 # inject replace command in meta-links to make sure editURL and issuesURL point to right version
119- sed -i "12i \{\{ \$gh_file = replaceRE \`\^operate\/rs\/\` \"operate\/rs\/$version\/\" \$gh_file }}" layouts/partials/meta-links.html
127+ sed -i "12i \{\{ \$gh_path = replaceRE \`\^operate\/rs\/\` \"operate\/rs\/$version\/\" \$gh_path }}" layouts/partials/meta-links.html
120128
121129 hugo -d "rs-${version}"
122130
@@ -133,13 +141,17 @@ jobs:
133141 rm -r "content/integrate/redis-data-integration/${version_to_remove}"
134142 done
135143
136- cp -r "content/integrate/redis-data-integration/${version}"/* content/integrate/redis-data-integration/
137- rm -r "content/integrate/redis-data-integration/${version}"
144+ # relrefs should not include version
145+ find "content/operate/redis-data-integration/${version}" -type f | while read file; do
146+ awk '{gsub(/\(\{\{< ?relref "\/operate\/redis-data-integration\/'${version}'/, "({{< relref \"/operate/redis-data-integration") }1' "$file" > tmpfile && mv tmpfile "$file"
147+ done
148+
149+ rsync -a --delete-after "content/operate/redis-data-integration/${version}"/ content/operate/redis-data-integration/
138150 sed -i 's/id="versionSelectorRedis-Data-IntegrationValue" class="version-selector-control">latest/id="versionSelectorRedis-Data-IntegrationValue" class="version-selector-control">v'"${version}"'/' layouts/partials/docs-nav.html
139151 sed -i 's/linkTitle: '"${version}"'/linkTitle: Redis Data Integration/' content/integrate/redis-data-integration/_index.md
140152
141153 # inject replace command in meta-links to make sure editURL and issuesURL point to right version
142- sed -i "12i \{\{ \$gh_file = replaceRE \`\^integrate\/redis-data-integration\/\` \"integrate\/redis-data-integration\/$version\/\" \$gh_file }}" layouts/partials/meta-links.html
154+ sed -i "12i \{\{ \$gh_path = replaceRE \`\^integrate\/redis-data-integration\/\` \"integrate\/redis-data-integration\/$version\/\" \$gh_path }}" layouts/partials/meta-links.html
143155
144156 hugo -d "redis-data-integration-${version}"
145157
@@ -181,9 +193,9 @@ jobs:
181193 for versioned_build in "${versioned_builds[@]}"; do
182194 product=$(awk 'BEGIN{FS=OFS="-"}{NF--; print}' <<< $versioned_build)
183195 if [[ "${product}" == "redis-data-integration" ]]; then
184- gsutil -m rsync -r -c -j html -d "${{ github.workspace }}/${versioned_build}/integrate/${product}" "gs://${BUCKET}/${versioned_build}/integrate/${product}"
196+ gsutil -m rsync -r -c -j html -d "${{ github.workspace }}/${versioned_build}/integrate/${product}/ " "gs://${BUCKET}/${bucket_path }/${versioned_build}/integrate/${product}"
185197 else
186- gsutil -m rsync -r -c -j html -d "${{ github.workspace }}/${versioned_build}/operate/${product}" "gs://${BUCKET}/${versioned_build}/operate/${product}"
198+ gsutil -m rsync -r -c -j html -d "${{ github.workspace }}/${versioned_build}/operate/${product}/ " "gs://${BUCKET}/${bucket_path }/${versioned_build}/operate/${product}"
187199 fi
188200 done
189201
0 commit comments