|
60 | 60 | setBaseUrl
|
61 | 61 | kubernetes_versions=($(find content/operate/kubernetes/ -maxdepth 1 -type d -regex ".*[0-9-]" | awk -F/ '{print $NF}'))
|
62 | 62 | rs_versions=($(find content/operate/rs/ -maxdepth 1 -type d -regex ".*[0-9-]" | awk -F/ '{print $NF}'))
|
| 63 | + rdi_versions=($(find content/integrate/redis-data-integration/ -maxdepth 1 -type d -regex ".*[0-9-]" | awk -F/ '{print $NF}')) |
63 | 64 |
|
64 | 65 | # build latest
|
65 | 66 | for version in "${kubernetes_versions[@]}"; do
|
|
68 | 69 | for version in "${rs_versions[@]}"; do
|
69 | 70 | rm -r "content/operate/rs/${version}"
|
70 | 71 | done
|
| 72 | + for version in "${rdi_versions[@]}"; do |
| 73 | + rm -r "content/integrate/redis-data-integration/${version}" |
| 74 | + done |
71 | 75 | make all
|
72 | 76 |
|
73 | 77 | git checkout .
|
@@ -119,6 +123,29 @@ jobs:
|
119 | 123 | git checkout .
|
120 | 124 | done
|
121 | 125 |
|
| 126 | + for version in "${rdi_versions[@]}"; do |
| 127 | +
|
| 128 | + setBaseUrl |
| 129 | +
|
| 130 | + # for each version, remove all other versions before building |
| 131 | + versions_to_remove=($(echo "${rdi_versions[@]}" "${version}" | tr ' ' '\n' | sort | uniq -u)) |
| 132 | + for version_to_remove in "${versions_to_remove[@]}"; do |
| 133 | + rm -r "content/integrate/redis-data-integration/${version_to_remove}" |
| 134 | + done |
| 135 | +
|
| 136 | + cp -r "content/integrate/redis-data-integration/${version}"/* content/integrate/redis-data-integration/ |
| 137 | + rm -r "content/integrate/redis-data-integration/${version}" |
| 138 | + 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 |
| 139 | + sed -i 's/linkTitle: '"${version}"'/linkTitle: Redis Data Integration/' content/integrate/redis-data-integration/_index.md |
| 140 | +
|
| 141 | + # 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 |
| 143 | +
|
| 144 | + hugo -d "redis-data-integration-${version}" |
| 145 | +
|
| 146 | + git checkout . |
| 147 | + done |
| 148 | +
|
122 | 149 | - name: List client examples
|
123 | 150 | run: ls "${{ github.workspace }}/examples"
|
124 | 151 | - name: List files to be published
|
@@ -154,17 +181,25 @@ jobs:
|
154 | 181 | then
|
155 | 182 | versioned_builds=($(find . -type d -regex ".*[0-9-]" -maxdepth 1 | sed -E 's/^.\///'))
|
156 | 183 | for versioned_build in "${versioned_builds[@]}"; do
|
157 |
| - product=$(grep -Eo '[a-zA-Z]+' <<< $versioned_build) |
158 |
| - gsutil -m rsync -r -c -j html -d "${{ github.workspace }}/${versioned_build}/operate/${product}" "gs://${BUCKET}/${versioned_build}/operate/${product}" |
| 184 | + product=$(awk 'BEGIN{FS=OFS="-"}{NF--; print}' <<< $versioned_build) |
| 185 | + if [[ "${product}" == "redis-data-integration" ]]; then |
| 186 | + gsutil -m rsync -r -c -j html -d "${{ github.workspace }}/${versioned_build}/integrate/${product}" "gs://${BUCKET}/${versioned_build}/integrate/${product}" |
| 187 | + else |
| 188 | + gsutil -m rsync -r -c -j html -d "${{ github.workspace }}/${versioned_build}/operate/${product}" "gs://${BUCKET}/${versioned_build}/operate/${product}" |
| 189 | + fi |
159 | 190 | done
|
160 | 191 | fi
|
161 | 192 |
|
162 | 193 | if [[ "$bucket_path" == staging/* ]]
|
163 | 194 | then
|
164 | 195 | versioned_builds=($(find . -type d -regex ".*[0-9-]" -maxdepth 1 | sed -E 's/^.\///'))
|
165 | 196 | for versioned_build in "${versioned_builds[@]}"; do
|
166 |
| - product=$(grep -Eo '[a-zA-Z]+' <<< $versioned_build) |
167 |
| - gsutil -m rsync -r -c -j html -d "${{ github.workspace }}/${versioned_build}/operate/${product}" "gs://${BUCKET}/${bucket_path}/${versioned_build}/operate/${product}" |
| 197 | + product=$(awk 'BEGIN{FS=OFS="-"}{NF--; print}' <<< $versioned_build) |
| 198 | + if [[ "${product}" == "redis-data-integration" ]]; then |
| 199 | + gsutil -m rsync -r -c -j html -d "${{ github.workspace }}/${versioned_build}/integrate/${product}" "gs://${BUCKET}/${bucket_path}/${versioned_build}/integrate/${product}" |
| 200 | + else |
| 201 | + gsutil -m rsync -r -c -j html -d "${{ github.workspace }}/${versioned_build}/operate/${product}" "gs://${BUCKET}/${bucket_path}/${versioned_build}/operate/${product}" |
| 202 | + fi |
168 | 203 | done
|
169 | 204 | fi
|
170 | 205 |
|
|
0 commit comments