Skip to content

Commit d1a11a5

Browse files
authored
Update the logic of preparing autorest's code in CI pipeline (#24239)
* Update the logic of preparing autorest's code in CI pipeline * Fix the quotation
1 parent 8ab084f commit d1a11a5

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

.azure-pipelines/code-oob.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ stages:
2626
custom: msbuild
2727
arguments: 'build.proj "/t:Clean;Build" /p:Configuration=Release;TargetModule=${{ parameters.ServiceName }}'
2828
- pwsh: |
29-
.\tools\RunVersionController.ps1 -ModuleName "Az.${{ parameters.ServiceName }}
29+
.\tools\RunVersionController.ps1 -ModuleName "Az.${{ parameters.ServiceName }}"
3030
displayName: 'Bump up version'
3131
- task: PowerShell@2
3232
displayName: get changelog info

tools/PrepareAutorestModule.ps1

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ $FailedModuleList = @()
9595
foreach ($Module in $ModuleList)
9696
{
9797
$RootModuleFolder = "$PSScriptRoot\..\src\$Module\"
98-
$SubModuleFolders = (Get-ChildItem -path $RootModuleFolder -filter Az.*.psd1 -Recurse).Directory
98+
$SubModuleFolders = Get-ChildItem -path $RootModuleFolder -filter *.Autorest -Directory
9999
if ($Null -eq $SubModuleFolders)
100100
{
101101
# Module is not found maybe it's deleted in this PR
@@ -140,8 +140,13 @@ if ($FailedModuleList.Length -ne 0)
140140
Write-Error "Failed to generate code for module(s): $FailedModuleList"
141141
foreach ($failedModule in $FailedModuleList)
142142
{
143-
Write-Error "========= Error log for $failedModule ========="
144-
Write-Host (Get-Content "$AutorestOutputDir\$failedModule.log")
143+
Write-Error "========= Start of error log for $failedModule ========="
144+
$Logs = Get-Content "$AutorestOutputDir\$failedModule.log"
145+
foreach ($line in $Logs)
146+
{
147+
Write-Error $line
148+
}
149+
Write-Error "========= End of error log for $failedModule ========="
145150
}
146151
exit 1
147152
}

0 commit comments

Comments
 (0)