Update to azCopy 10 (#18509)

This commit is contained in:
Travis Plunk
2022-11-09 13:55:35 -08:00
committed by GitHub
parent 6fd7d2fd15
commit 58f2b2c8d0
5 changed files with 45 additions and 24 deletions
@@ -283,6 +283,7 @@ stages:
variables:
- group: 'Azure Blob variable group'
- group: 'AzDevOpsArtifacts'
- group: ReleasePipelineSecrets
dependsOn: AzureBlobPublic
steps:
- template: templates/release-CreateGitHubDraft.yml
@@ -10,15 +10,27 @@ steps:
Import-module '$(BUILD.SOURCESDIRECTORY)/build.psm1'
Install-AzCopy
displayName: Install AzCopy
retryCountOnTaskFailure: 2
- pwsh: |
Import-module '$(BUILD.SOURCESDIRECTORY)/build.psm1'
$azcopy = Find-AzCopy
& $azcopy /Source:https://$(StorageAccount).blob.core.windows.net/$(AzureVersion) /Dest:$(System.ArtifactsDirectory) /S /SourceKey:$(StorageAccountKey)
Write-Verbose -Verbose "Found AzCopy: $azcopy"
& $azcopy login --service-principal --application-id $(PowerShellReleaseSPN)
& $azcopy cp https://$(StorageAccount).blob.core.windows.net/$(AzureVersion) $(System.ArtifactsDirectory) --recursive
$packagesPath = Get-ChildItem -Path $(System.ArtifactsDirectory)\*.deb -Recurse -File | Select-Object -First 1 -ExpandProperty DirectoryName
Write-Host "sending -- vso[task.setvariable variable=PackagesRoot]$packagesPath"
Write-Host "##vso[task.setvariable variable=PackagesRoot]$packagesPath"
displayName: Download Azure Artifacts
retryCountOnTaskFailure: 2
env:
AZCOPY_SPA_CLIENT_SECRET: $(PowerShellReleaseSPNSecret)
- pwsh: |
Get-ChildItem $(System.ArtifactsDirectory)\* -recurse | Select-Object -ExpandProperty Name
Get-ChildItem $(System.ArtifactsDirectory)\* -recurse | Select-Object -ExpandProperty FullName
displayName: Capture downloaded artifacts
- pwsh: |
@@ -26,10 +38,10 @@ steps:
displayName: Clone Internal-Tools repository
- pwsh: |
$Path = "$(System.ArtifactsDirectory)"
$Path = "$(PackagesRoot)"
$OutputPath = Join-Path $Path ‘hashes.sha256’
$srcPaths = @($Path)
$packages = Get-ChildItem -Path $srcPaths -Include * -Recurse
$packages = Get-ChildItem -Path $srcPaths -Include * -Recurse -File
$checksums = $packages |
ForEach-Object {
Write-Verbose -Verbose "Generating checksum file for $($_.FullName)"
@@ -77,5 +89,5 @@ steps:
Write-Verbose -Verbose "Selected content: `n$clContent"
Publish-ReleaseDraft -Tag '$(ReleaseTag)' -Name '$(ReleaseTag) Release of PowerShell' -Description $clContent -User PowerShell -Repository PowerShell -PackageFolder $(System.ArtifactsDirectory) -Token $(GitHubReleasePat)
Publish-ReleaseDraft -Tag '$(ReleaseTag)' -Name '$(ReleaseTag) Release of PowerShell' -Description $clContent -User PowerShell -Repository PowerShell -PackageFolder $(PackagesRoot) -Token $(GitHubReleasePat)
displayName: Publish Release Draft
@@ -65,16 +65,13 @@ jobs:
Write-Host "##$vstsCommandString"
displayName: Create MsixBundle
- pwsh: |
Import-module '$(BUILD.SOURCESDIRECTORY)/build.psm1'
Install-AzCopy
displayName: Install AzCopy
- pwsh: |
## We use AzCopy v8.1 in our release pipeline, see the documentation at:
## https://docs.microsoft.com/en-us/previous-versions/azure/storage/storage-use-azcopy
Import-module '$(BUILD.SOURCESDIRECTORY)/build.psm1'
$azcopy = Find-AzCopy
& $azcopy /Source:$(BundleDir) /Dest:https://$(StorageAccount).blob.core.windows.net/$(AzureVersion)-private /DestKey:$(StorageAccountKey) /Pattern:*.msixbundle /Y
displayName: Upload MSIX Bundle package to Az Blob
- task: AzureFileCopy@4
displayName: 'Upload MSIX Bundle package to Az Blob'
inputs:
SourcePath: '$(BundleDir)/*.msixbundle'
azureSubscription: '$(AzureFileCopySubscription)'
Destination: AzureBlob
storage: '$(StorageAccount)'
ContainerName: '$(AzureVersion)-private'
resourceGroup: '$(StorageResourceGroup)'
condition: succeeded()
@@ -5,6 +5,7 @@ jobs:
- job: vpack_${{ parameters.architecture }}
variables:
- group: vPack
- group: ReleasePipelineSecrets
displayName: Build and Publish VPack - ${{ parameters.architecture }}
condition: succeeded()
@@ -31,14 +32,22 @@ jobs:
Import-module '$(BUILD.SOURCESDIRECTORY)/build.psm1'
Install-AzCopy
displayName: Install AzCopy
retryCountOnTaskFailure: 2
- pwsh: |
Import-module '$(BUILD.SOURCESDIRECTORY)/build.psm1'
$azcopy = Find-AzCopy
Write-Verbose -Verbose "Found AzCopy: $azcopy"
Write-Host "running: $azcopy /Source:https://$(StorageAccount).blob.core.windows.net/$(AzureVersion) /Dest:$(System.ArtifactsDirectory) /S /SourceKey:****** /Pattern:PowerShell-$(Version)-win-${{ parameters.architecture }}.zip /Z:$(AGENT.TEMPDIRECTORY)"
& $azcopy /Source:https://$(StorageAccount).blob.core.windows.net/$(AzureVersion) /Dest:$(System.ArtifactsDirectory) /S /SourceKey:$(StorageAccountKey) /Pattern:PowerShell-$(Version)-win-${{ parameters.architecture }}.zip /Z:$(AGENT.TEMPDIRECTORY)
& $azcopy login --service-principal --application-id $(PowerShellReleaseSPN)
Write-Host "running: $azcopy cp https://$(StorageAccount).blob.core.windows.net/$(AzureVersion)/PowerShell-$(Version)-win-${{ parameters.architecture }}.zip $(System.ArtifactsDirectory)"
& $azcopy cp https://$(StorageAccount).blob.core.windows.net/$(AzureVersion)/PowerShell-$(Version)-win-${{ parameters.architecture }}.zip $(System.ArtifactsDirectory)
displayName: 'Download Azure Artifacts'
retryCountOnTaskFailure: 2
env:
AZCOPY_SPA_CLIENT_SECRET: $(PowerShellReleaseSPNSecret)
- pwsh: 'Get-ChildItem $(System.ArtifactsDirectory)\* -recurse | Select-Object -ExpandProperty Name'
displayName: 'Capture Artifact Listing'