Remove SAS token from GitHubIO blob storage docs publish (#1584)
Co-authored-by: James Suplizio <jasupliz@microsoft.com>
This commit is contained in:
Родитель
e1867bc4cd
Коммит
bf9c1d95c3
|
@ -1,6 +1,5 @@
|
|||
parameters:
|
||||
FolderForUpload: ''
|
||||
BlobSASKey: ''
|
||||
TargetLanguage: ''
|
||||
BlobName: ''
|
||||
ScriptPath: ''
|
||||
|
@ -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]
|
||||
-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'
|
||||
|
|
|
@ -4,7 +4,6 @@
|
|||
param (
|
||||
$AzCopy,
|
||||
$DocLocation,
|
||||
$SASKey,
|
||||
$BlobName,
|
||||
$ExitOnError=1,
|
||||
$UploadLatest=1,
|
||||
|
@ -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
|
||||
}
|
||||
|
||||
|
@ -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)
|
||||
|
@ -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"
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче