Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sync eng/common directory with azure-sdk-tools for PR 1022 #13885

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 23 additions & 22 deletions eng/common/scripts/copy-docs-to-blobstorage.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -257,30 +257,31 @@ if ($Language -eq "javascript")

if ($Language -eq "dotnet")
{
$PublishedPkgs = Get-ChildItem "$($DocLocation)/packages" | Where-Object -FilterScript {$_.Name.EndsWith(".nupkg") -and -not $_.Name.EndsWith(".symbols.nupkg")}
$PublishedDocs = Get-ChildItem "$($DocLocation)" | Where-Object -FilterScript {$_.Name.StartsWith("Docs.")}
$PublishedPkgs = Get-ChildItem "$($DocLocation)" | Where-Object -FilterScript {$_.Name.EndsWith(".nupkg") -and -not $_.Name.EndsWith(".symbols.nupkg")}
$PublishedDocs = Get-ChildItem "$($DocLocation)" | Where-Object -FilterScript {$_.Name.EndsWith("docs.zip")}

foreach ($Item in $PublishedDocs) {
$PkgName = $Item.Name.Remove(0, 5)
$PkgFullName = $PublishedPkgs | Where-Object -FilterScript {$_.Name -match "$($PkgName).\d"}

if (($PkgFullName | Measure-Object).count -eq 1)
{
$DocVersion = $PkgFullName[0].BaseName.Remove(0, $PkgName.Length + 1)

Write-Host "Start Upload for $($PkgName)/$($DocVersion)"
Write-Host "DocDir $($Item)"
Write-Host "PkgName $($PkgName)"
Write-Host "DocVersion $($DocVersion)"
$releaseTag = RetrieveReleaseTag "Nuget" $PublicArtifactLocation
Upload-Blobs -DocDir "$($Item)" -PkgName $PkgName -DocVersion $DocVersion -ReleaseTag $releaseTag
}
else
{
Write-Host "Package with the same name Exists. Upload Skipped"
continue
}
if (($PublishedPkgs.Count -gt 1) -or ($PublishedDoc.Count -gt 1))
{
Write-Host "$($DocLocation) should contain only one (1) published package and docs"
Write-Host "No of Packages $($PublishedPkgs.Count)"
Write-Host "No of Docs $($PublishedDoc.Count)"
exit 1
}

$DocsStagingDir = "$WorkingDirectory/docstaging"
$TempDir = "$WorkingDirectory/temp"

New-Item -ItemType directory -Path $DocsStagingDir
New-Item -ItemType directory -Path $TempDir

Expand-Archive -LiteralPath $PublishedDocs[0].FullName -DestinationPath $DocsStagingDir
$pkgProperties = ParseNugetPackage -pkg $PublishedPkgs[0].FullName -workingDirectory $TempDir

Write-Host "Start Upload for $($pkgProperties.ReleaseTag)"
Write-Host "DocDir $($DocsStagingDir)"
Write-Host "PkgName $($pkgProperties.PackageId)"
Write-Host "DocVersion $($pkgProperties.PackageVersion)"
Upload-Blobs -DocDir "$($DocsStagingDir)" -PkgName $pkgProperties.PackageId -DocVersion $pkgProperties.PackageVersion -ReleaseTag $pkgProperties.ReleaseTag
}

if ($Language -eq "python")
Expand Down