Move artifacts to artifact staging directory before uploading (#9273)

This commit is contained in:
Aditya Patwardhan authored and GitHub committed 2019-04-02 11:56:48 -07:00
1 parent 5e4b4d1351
commit 10fa1fc1dd
1 file changed
+18 -5
+18 -5
View File
@@ -346,13 +346,26 @@ function Invoke-CIAfterTest
$codeCoverageOutput = Split-Path -Parent (Get-PSOutput)
$codeCoverageArtifacts = Compress-CoverageArtifacts -CodeCoverageOutput $codeCoverageOutput
Write-Host -ForegroundColor Green 'Upload CodeCoverage artifacts'
$codeCoverageArtifacts | ForEach-Object {
Push-Artifact -Path $_ -Name 'CodeCoverage'
$destBasePath = if ($env:TF_BUILD) {
$env:BUILD_ARTIFACTSTAGINGDIRECTORY
} else {
Join-Path (Get-Location).Path "out"
}
New-TestPackage -Destination (Get-Location).Path
$testPackageFullName = Join-Path $pwd 'TestPackage.zip'
if (-not (Test-Path $destBasePath))
{
$null = New-Item -ItemType Directory -Path $destBasePath
}
Write-Host -ForegroundColor Green 'Upload CodeCoverage artifacts'
$codeCoverageArtifacts | ForEach-Object {
Copy-Item -Path $_ -Destination $destBasePath
$newPath = Join-Path $destBasePath (Split-Path $_ -Leaf)
Push-Artifact -Path $newPath -Name 'CodeCoverage'
}
New-TestPackage -Destination $destBasePath
$testPackageFullName = Join-Path $destBasePath 'TestPackage.zip'
Write-Verbose "Created TestPackage.zip" -Verbose
Write-Host -ForegroundColor Green 'Upload test package'
Push-Artifact $testPackageFullName -Name 'CodeCoverage'