From 49c81c20be087c5155c6cac0c00d06b286d12b0a Mon Sep 17 00:00:00 2001 From: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com> Date: Tue, 5 Jan 2021 19:30:25 -0800 Subject: [PATCH] Sync eng/common directory with azure-sdk-tools for PR 1298 (#1262) * 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 --- eng/common/scripts/copy-docs-to-blobstorage.ps1 | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/eng/common/scripts/copy-docs-to-blobstorage.ps1 b/eng/common/scripts/copy-docs-to-blobstorage.ps1 index 9e6ddf810..c4dfb1894 100644 --- a/eng/common/scripts/copy-docs-to-blobstorage.ps1 +++ b/eng/common/scripts/copy-docs-to-blobstorage.ps1 @@ -216,13 +216,15 @@ function Upload-Blobs LogDebug "Uploading $($PkgName)/$($DocVersion) to $($DocDest)..." & $($AzCopy) cp "$($DocDir)/**" "$($DocDest)/$($PkgName)/$($DocVersion)$($SASKey)" --recursive=true --cache-control "max-age=300, must-revalidate" - + LogDebug "Handling versioning files under $($DocDest)/$($PkgName)/versioning/" $versionsObj = (Update-Existing-Versions -PkgName $PkgName -PkgVersion $DocVersion -DocDest $DocDest) - - # we can safely assume we have AT LEAST one version here. Reason being we just completed Update-Existing-Versions - $latestVersion = ($versionsObj.SortedVersionArray | Select-Object -First 1).RawVersion - + $latestVersion = $versionsObj.LatestGAPackage + if (!$latestVersion) { + $latestVersion = $versionsObj.LatestPreviewPackage + } + LogDebug "Fetching the latest version $latestVersion" + if ($UploadLatest -and ($latestVersion -eq $DocVersion)) { LogDebug "Uploading $($PkgName) to latest folder in $($DocDest)..." @@ -230,7 +232,6 @@ function Upload-Blobs } } - if ($PublishGithubIODocsFn -and (Test-Path "Function:$PublishGithubIODocsFn")) { &$PublishGithubIODocsFn -DocLocation $DocLocation -PublicArtifactLocation $PublicArtifactLocation