Skip to content
Merged
Show file tree
Hide file tree
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
18 changes: 10 additions & 8 deletions eng/common/pipelines/templates/steps/publish-blobs.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
parameters:
FolderForUpload: ''
BlobSASKey: ''
Comment thread
danieljurek marked this conversation as resolved.
TargetLanguage: ''
BlobName: ''
ScriptPath: ''
Expand All @@ -17,17 +16,20 @@ steps:
workingDirectory: $(Build.BinariesDirectory)
displayName: Download and Extract azcopy Zip

- task: Powershell@2
- task: AzurePowerShell@5
displayName: 'Copy Docs to Blob Storage'
continueOnError: false
inputs:
filePath: ${{ parameters.ScriptPath }}
arguments: >
azureSubscription: 'Azure SDK Artifacts'
ScriptType: 'FilePath'
ScriptPath: ${{ parameters.ScriptPath }}
ScriptArguments: >
-AzCopy $(Resolve-Path "$(Build.BinariesDirectory)/azcopy/azcopy_windows_amd64_*/azcopy.exe")[0]
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Orthogonal but we should probably also remove this azcopy approach given it is already on all the agent machines.

-DocLocation "${{ parameters.FolderForUpload }}"
-SASKey "${{ parameters.BlobSASKey }}"
-BlobName "${{ parameters.BlobName }}"
-PublicArtifactLocation "${{ parameters.ArtifactLocation }}"
-RepoReplaceRegex "(https://github.com/${{ parameters.RepoId }}/(?:blob|tree)/)$(DefaultBranch)"
azurePowerShellVersion: latestVersion
pwsh: true
workingDirectory: $(Pipeline.Workspace)
displayName: Copy Docs to Blob
continueOnError: false
env:
AZCOPY_AUTO_LOGIN_TYPE: 'PSCRED'
11 changes: 5 additions & 6 deletions eng/common/scripts/copy-docs-to-blobstorage.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
param (
$AzCopy,
$DocLocation,
$SASKey,
$BlobName,
$ExitOnError=1,
$UploadLatest=1,
Expand Down Expand Up @@ -176,9 +175,9 @@ function Update-Existing-Versions
$sortedVersionObj.LatestGAPackage | Out-File -File "$($DocLocation)/latest-ga" -Force -NoNewLine
$sortedVersionObj.LatestPreviewPackage | Out-File -File "$($DocLocation)/latest-preview" -Force -NoNewLine

& $($AzCopy) cp "$($DocLocation)/versions" "$($DocDest)/$($PkgName)/versioning/versions$($SASKey)" --cache-control "max-age=300, must-revalidate"
& $($AzCopy) cp "$($DocLocation)/latest-preview" "$($DocDest)/$($PkgName)/versioning/latest-preview$($SASKey)" --cache-control "max-age=300, must-revalidate"
& $($AzCopy) cp "$($DocLocation)/latest-ga" "$($DocDest)/$($PkgName)/versioning/latest-ga$($SASKey)" --cache-control "max-age=300, must-revalidate"
& $($AzCopy) cp "$($DocLocation)/versions" "$($DocDest)/$($PkgName)/versioning/versions" --cache-control "max-age=300, must-revalidate"
& $($AzCopy) cp "$($DocLocation)/latest-preview" "$($DocDest)/$($PkgName)/versioning/latest-preview" --cache-control "max-age=300, must-revalidate"
& $($AzCopy) cp "$($DocLocation)/latest-ga" "$($DocDest)/$($PkgName)/versioning/latest-ga" --cache-control "max-age=300, must-revalidate"
return $sortedVersionObj
}

Expand Down Expand Up @@ -216,7 +215,7 @@ 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"
& $($AzCopy) cp "$($DocDir)/**" "$($DocDest)/$($PkgName)/$($DocVersion)" --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)
Expand All @@ -229,7 +228,7 @@ function Upload-Blobs
if ($UploadLatest -and ($latestVersion -eq $DocVersion))
{
LogDebug "Uploading $($PkgName) to latest folder in $($DocDest)..."
& $($AzCopy) cp "$($DocDir)/**" "$($DocDest)/$($PkgName)/latest$($SASKey)" --recursive=true --cache-control "max-age=300, must-revalidate"
& $($AzCopy) cp "$($DocDir)/**" "$($DocDest)/$($PkgName)/latest" --recursive=true --cache-control "max-age=300, must-revalidate"
}
}

Expand Down