File tree Expand file tree Collapse file tree 2 files changed +25
-0
lines changed Expand file tree Collapse file tree 2 files changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -125,6 +125,7 @@ jobs:
125125 - template : /eng/pipelines/templates/steps/set-artifact-packages.yml
126126 parameters :
127127 PackageInfo : ' $(Build.SourcesDirectory)/PackageInfo'
128+ Restore : true
128129
129130 - pwsh : |
130131 if ("$(ProjectNames)" -like "*storage*") {
Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ parameters:
22 PackageInfo : ' '
33 Artifacts : []
44 IncludeIndirect : true
5+ Restore : false
56steps :
67 # Package-Properties folder contains the package properties for all discovered packages that were either A) affected by the PR or
78 # B) explicitly present in the service directory. This repo splits the builds into two categories: "mgmt" and "dataplane". While
@@ -49,3 +50,26 @@ steps:
4950 displayName: Resolve Service and Project List
5051 condition: ne(variables['ProjectNames'], '')
5152
53+ - ${{ if eq(parameters.Restore, true) }} :
54+ - template : /eng/common/testproxy/test-proxy-tool.yml
55+ parameters :
56+ runProxy : false
57+
58+ - pwsh : |
59+ $packageProperties = Get-ChildItem -Recurse '${{ parameters.PackageInfo }}' -Filter *.json `
60+ | Foreach-Object { Get-Content -Raw -Path $_.FullName | ConvertFrom-Json }
61+ $packageSet = "$(ProjectNames)" -split ","
62+ $changedProjects = $packageProperties | Where-Object { $packageSet -contains $_.ArtifactName }
63+
64+ foreach ($proj in $changedProjects) {
65+ $assets = Join-Path (Join-Path "$(Build.SourcesDirectory)" $proj.DirectoryPath) "assets.json"
66+ if (Test-Path $assets) {
67+ Write-Host "Restoring $assets"
68+ if ($IsWindows) {
69+ & "$(Build.BinariesDirectory)/test-proxy/test-proxy.exe" restore -a $assets
70+ } else {
71+ & "$(Build.BinariesDirectory)/test-proxy/test-proxy" restore -a $assets
72+ }
73+ }
74+ }
75+ displayName: Restore Recordings
You can’t perform that action at this time.
0 commit comments