Skip to content

Commit dbbb326

Browse files
azure-sdksima-zhu
andauthored
Sync eng/common directory with azure-sdk-tools for PR 1298 (Azure#18456)
* Update latest folder with one index.html includes the redirect links * Update the redirect links and remove everything in latest * Address feedback * Have the entire copy for latest GA. Co-authored-by: Sima Zhu <[email protected]>
1 parent fb3f187 commit dbbb326

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

eng/common/scripts/copy-docs-to-blobstorage.ps1

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -216,21 +216,22 @@ function Upload-Blobs
216216

217217
LogDebug "Uploading $($PkgName)/$($DocVersion) to $($DocDest)..."
218218
& $($AzCopy) cp "$($DocDir)/**" "$($DocDest)/$($PkgName)/$($DocVersion)$($SASKey)" --recursive=true --cache-control "max-age=300, must-revalidate"
219-
219+
220220
LogDebug "Handling versioning files under $($DocDest)/$($PkgName)/versioning/"
221221
$versionsObj = (Update-Existing-Versions -PkgName $PkgName -PkgVersion $DocVersion -DocDest $DocDest)
222-
223-
# we can safely assume we have AT LEAST one version here. Reason being we just completed Update-Existing-Versions
224-
$latestVersion = ($versionsObj.SortedVersionArray | Select-Object -First 1).RawVersion
225-
222+
$latestVersion = $versionsObj.LatestGAPackage
223+
if (!$latestVersion) {
224+
$latestVersion = $versionsObj.LatestPreviewPackage
225+
}
226+
LogDebug "Fetching the latest version $latestVersion"
227+
226228
if ($UploadLatest -and ($latestVersion -eq $DocVersion))
227229
{
228230
LogDebug "Uploading $($PkgName) to latest folder in $($DocDest)..."
229231
& $($AzCopy) cp "$($DocDir)/**" "$($DocDest)/$($PkgName)/latest$($SASKey)" --recursive=true --cache-control "max-age=300, must-revalidate"
230232
}
231233
}
232234

233-
234235
if ($PublishGithubIODocsFn -and (Test-Path "Function:$PublishGithubIODocsFn"))
235236
{
236237
&$PublishGithubIODocsFn -DocLocation $DocLocation -PublicArtifactLocation $PublicArtifactLocation

0 commit comments

Comments
 (0)