From d7c7fa504fe3cc82d68c11d10359aef87fdbd7e7 Mon Sep 17 00:00:00 2001 From: Aditya Patwardhan Date: Mon, 29 Oct 2018 14:13:05 -0700 Subject: [PATCH] Filter the TestPackage artifact upload by name to avoid other zip files being uploaded (#8116) --- .vsts-ci/linux.yml | 2 +- .vsts-ci/mac.yml | 2 +- build.psm1 | 3 +++ 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.vsts-ci/linux.yml b/.vsts-ci/linux.yml index 5865686ae8..df15463434 100644 --- a/.vsts-ci/linux.yml +++ b/.vsts-ci/linux.yml @@ -78,7 +78,7 @@ phases: # Uploads any packages as an artifact - powershell: | - Get-ChildItem -Path *.rpm, *.deb, *.tar.gz, *.zip -Recurse | Select-Object -ExpandProperty FullName | ForEach-Object { + Get-ChildItem -Path *.rpm, *.deb, *.tar.gz, TestPackage.zip -Recurse | Select-Object -ExpandProperty FullName | ForEach-Object { Write-Host "##vso[artifact.upload containerfolder=artifacts;artifactname=artifacts]$_" } displayName: Publish Artifacts diff --git a/.vsts-ci/mac.yml b/.vsts-ci/mac.yml index 985d905c7b..f3df0aab4b 100644 --- a/.vsts-ci/mac.yml +++ b/.vsts-ci/mac.yml @@ -53,7 +53,7 @@ phases: # Uploads any packages as an artifact - powershell: | - Get-ChildItem -Path *.pkg, *.tar.gz, *.zip -Recurse | Select-Object -ExpandProperty FullName | ForEach-Object { + Get-ChildItem -Path *.pkg, *.tar.gz, TestPackage.zip -Recurse | Select-Object -ExpandProperty FullName | ForEach-Object { Write-Host "##vso[artifact.upload containerfolder=artifacts;artifactname=artifacts]$_" } displayName: Publish Artifacts diff --git a/build.psm1 b/build.psm1 index e689b6bf52..0ee4ca62da 100644 --- a/build.psm1 +++ b/build.psm1 @@ -3003,9 +3003,12 @@ function New-TestPackage $rootFolder = $env:AGENT_WORKFOLDER } + Write-Verbose -Verbose "RootFolder: $rootFolder" + $packageRoot = Join-Path $rootFolder ('TestPackage-' + (new-guid)) $null = New-Item -ItemType Directory -Path $packageRoot -Force $packagePath = Join-Path $Destination "TestPackage.zip" + Write-Verbose -Verbose "PackagePath: $packagePath" # Build test tools so they are placed in appropriate folders under 'test' then copy to package root. $null = Publish-PSTestTools