From 54769c96c02c39c362ae452cae3e9eaf9c1805be Mon Sep 17 00:00:00 2001 From: Tyler James Leonhardt Date: Thu, 3 Jun 2021 09:36:24 -0700 Subject: [PATCH] wait for all artifacts to be processed --- build/azure-pipelines/product-publish.ps1 | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/build/azure-pipelines/product-publish.ps1 b/build/azure-pipelines/product-publish.ps1 index 0059271113350..de53975fde3e1 100644 --- a/build/azure-pipelines/product-publish.ps1 +++ b/build/azure-pipelines/product-publish.ps1 @@ -48,16 +48,15 @@ $stages = @( if ($env:VSCODE_BUILD_STAGE_MACOS -eq 'True') { 'macOS' } ) +$artifacts = Get-PipelineArtifact -Name 'vscode_*' do { Start-Sleep -Seconds 10 - $res = Get-PipelineArtifact -Name 'vscode_*' - - if (!$res) { + if (!$artifacts) { continue } - $res | ForEach-Object { + $artifacts | ForEach-Object { $artifactName = $_.name if($set.Add($artifactName)) { Write-Host "Processing artifact: '$artifactName. Downloading from: $($_.resource.downloadUrl)" @@ -107,6 +106,9 @@ do { break } } -} while (!$otherStageFinished) + + $artifacts = Get-PipelineArtifact -Name 'vscode_*' + $artifactsStillToProcess = $artifacts.Count -ne $set.Count +} while (!$otherStageFinished -or $artifactsStillToProcess) Write-Host "Processed $($set.Count) artifacts."