From 22664ed1a1cd5bafae7a922c302505f129b36acc Mon Sep 17 00:00:00 2001 From: Marius Date: Sun, 6 Feb 2022 12:55:00 +0100 Subject: [PATCH 1/6] Introduce log grouping --- .../pipelineTemplates/jobs.publishModule.yml | 32 +++++++++++++++++++ .../jobs.validateModuleDeployment.yml | 24 ++++++++++++++ .../jobs.validateModulePester.yml | 24 ++++++++++++++ .../templates/getWorkflowInput/action.yml | 7 +++- .../templates/publishModule/action.yml | 12 +++++++ .../validateModuleDeployment/action.yml | 26 +++++++++++++++ .../templates/validateModulePester/action.yml | 15 +++++++++ 7 files changed, 139 insertions(+), 1 deletion(-) diff --git a/.azuredevops/pipelineTemplates/jobs.publishModule.yml b/.azuredevops/pipelineTemplates/jobs.publishModule.yml index 2164e11514..81ecf26e13 100644 --- a/.azuredevops/pipelineTemplates/jobs.publishModule.yml +++ b/.azuredevops/pipelineTemplates/jobs.publishModule.yml @@ -106,6 +106,8 @@ jobs: targetType: inline pwsh: true script: | + Write-Host "##[group]Setup agent" + # Load used functions . (Join-Path '$(System.DefaultWorkingDirectory)' 'utilities' 'pipelines' 'sharedScripts' 'Set-EnvironmentOnAgent.ps1') @@ -119,6 +121,8 @@ jobs: # Set agent up Set-EnvironmentOnAgent -PSModules $Modules + Write-Host "##[endgroup]" + # [Multi Repo] Support task #-------------------------- - task: PowerShell@2 @@ -127,6 +131,8 @@ jobs: targetType: inline pwsh: true script: | + Write-Host "##[group]Handle Multi-Repo Invocation" + # ---------------------------- # # HANDLE MULTI-REPO INVOCATION # # ---------------------------- # @@ -141,6 +147,8 @@ jobs: } Write-Host "##vso[task.setvariable variable=ENVMODULEPATH]$modulePath" + Write-Host "##[endgroup]" + # [Universal Artifact-feed publish] task(s) #------------------------------------------ - task: PowerShell@2 @@ -154,6 +162,8 @@ jobs: targetType: inline pwsh: true script: | + Write-Host "##[group]Publish module to artifacts feed" + # Load used functions . (Join-Path '$(System.DefaultWorkingDirectory)' '$(pipelineFunctionsPath)' 'resourcePublish' 'Get-ModulesToUpdate.ps1') . (Join-Path '$(System.DefaultWorkingDirectory)' '$(pipelineFunctionsPath)' 'resourcePublish' 'Publish-ModuleToUniversalArtifactFeed.ps1') @@ -174,8 +184,12 @@ jobs: # Get the modified child resources $ModulesToUpdate = Get-ModulesToUpdate @functionInput -Verbose + Write-Host "##[endgroup]" + # Publish the modified child resources foreach ($ModuleToUpdate in $ModulesToUpdate) { + Write-Host "##[group]- $($ModuleToUpdate.TemplateFilePath)" + $functionInput = @{ TemplateFilePath = $ModuleToUpdate.TemplateFilePath VstsOrganizationUri = '${{ parameters.vstsOrganizationUri }}' @@ -189,6 +203,8 @@ jobs: Write-Verbose ($functionInput | ConvertTo-Json | Out-String) -Verbose Publish-ModuleToUniversalArtifactFeed @functionInput -Verbose + + Write-Host "##[endgroup]" } env: TOKEN: $(vstsFeedToken) @@ -209,6 +225,8 @@ jobs: pwsh: true ScriptType: InlineScript inline: | + Write-Host "##[group]Publish module to template specs" + # Load used functions . (Join-Path '$(System.DefaultWorkingDirectory)' '$(pipelineFunctionsPath)' 'resourcePublish' 'Get-ModulesToUpdate.ps1') . (Join-Path '$(System.DefaultWorkingDirectory)' '$(pipelineFunctionsPath)' 'resourcePublish' 'Publish-ModuleToTemplateSpec.ps1') @@ -229,8 +247,12 @@ jobs: # Get the modified child resources $ModulesToUpdate = Get-ModulesToUpdate @functionInput -Verbose + Write-Host "##[endgroup]" + # Publish the modified child resources foreach ($ModuleToUpdate in $ModulesToUpdate) { + Write-Host "##[group]- $($ModuleToUpdate.TemplateFilePath)" + $functionInput = @{ TemplateFilePath = $ModuleToUpdate.TemplateFilePath TemplateSpecsRgName = '${{ parameters.templateSpecsRgName }}' @@ -243,6 +265,8 @@ jobs: Write-Verbose ($functionInput | ConvertTo-Json | Out-String) -Verbose Publish-ModuleToTemplateSpec @functionInput -Verbose + + Write-Host "##[endgroup]" } # [private bicep registry publish] task(s) @@ -261,6 +285,8 @@ jobs: pwsh: true ScriptType: InlineScript inline: | + Write-Host "##[group]Publish module to private bicep registry" + # Load used functions . (Join-Path '$(System.DefaultWorkingDirectory)' '$(pipelineFunctionsPath)' 'resourcePublish' 'Get-ModulesToUpdate.ps1') . (Join-Path '$(System.DefaultWorkingDirectory)' '$(pipelineFunctionsPath)' 'resourcePublish' 'Publish-ModuleToPrivateBicepRegistry.ps1') @@ -281,8 +307,12 @@ jobs: # Get the modified child resources $ModulesToUpdate = Get-ModulesToUpdate @functionInput -Verbose + Write-Host "##[endgroup]" + # Publish the modified child resources foreach ($ModuleToUpdate in $ModulesToUpdate) { + Write-Host "##[group]- $($ModuleToUpdate.TemplateFilePath)" + $functionInput = @{ TemplateFilePath = $ModuleToUpdate.TemplateFilePath BicepRegistryName = '${{ parameters.bicepRegistryName }}' @@ -295,4 +325,6 @@ jobs: Write-Verbose ($functionInput | ConvertTo-Json | Out-String) -Verbose Publish-ModuleToPrivateBicepRegistry @functionInput -Verbose + + Write-Host "##[endgroup]" } diff --git a/.azuredevops/pipelineTemplates/jobs.validateModuleDeployment.yml b/.azuredevops/pipelineTemplates/jobs.validateModuleDeployment.yml index 66901fb038..38354f179b 100644 --- a/.azuredevops/pipelineTemplates/jobs.validateModuleDeployment.yml +++ b/.azuredevops/pipelineTemplates/jobs.validateModuleDeployment.yml @@ -105,6 +105,8 @@ jobs: targetType: inline pwsh: true script: | + Write-Host "##[group]Setup agent" + # Load used functions . (Join-Path '$(System.DefaultWorkingDirectory)' 'utilities' 'pipelines' 'sharedScripts' 'Set-EnvironmentOnAgent.ps1') @@ -129,6 +131,8 @@ jobs: # Set agent up Set-EnvironmentOnAgent -PSModules $Modules + Write-Host "##[endgroup]" + # [Multi Repo] Support task #-------------------------- - task: PowerShell@2 @@ -137,6 +141,8 @@ jobs: targetType: inline pwsh: true script: | + Write-Host "##[group]Handle Multi-Repo Invocation" + # Handle multiple-repositories if( "${{ join(';',parameters.checkoutRepositories) }}".length -gt 0) { Write-Verbose "Multi-Repo Checkout" -Verbose @@ -150,6 +156,8 @@ jobs: Write-Host "##vso[task.setvariable variable=ModuleRepoRoot]$moduleRepoRoot" Write-Host "##vso[task.setvariable variable=parametersRepoRoot]$parametersRepoRoot" + Write-Host "##[endgroup]" + # [Agent] Replace tokens #----------------------- - task: AzurePowerShell@5 @@ -161,6 +169,8 @@ jobs: ScriptType: InlineScript pwsh: true inline: | + Write-Host "##[group]Replace Tokens [${{ deploymentBlock.path }}] via connection [${{ parameters.serviceConnection }}]" + # Load used functions . (Join-Path '$(moduleRepoRoot)' 'utilities' 'pipelines' 'tokensReplacement' 'Convert-TokensInParameterFile.ps1') @@ -192,6 +202,8 @@ jobs: # Invoke Token Replacement Functionality $null = Convert-TokensInParameterFile @ConvertTokensInputs -Verbose + Write-Host "##[endgroup]" + # [Validation] task(s) #--------------------- - task: AzurePowerShell@5 @@ -203,6 +215,8 @@ jobs: ScriptType: InlineScript pwsh: true inline: | + Write-Host "##[group]Validate [${{ deploymentBlock.path }}] via connection [${{ parameters.serviceConnection }}]" + # Load used functions . (Join-Path '$(moduleRepoRoot)' '$(pipelineFunctionsPath)' 'resourceValidation' 'Test-TemplateWithParameterFile.ps1') @@ -232,6 +246,8 @@ jobs: Test-TemplateWithParameterFile @functionInput -Verbose + Write-Host "##[endgroup]" + # [Deployment] task(s) #--------------------- - task: AzurePowerShell@5 @@ -244,6 +260,8 @@ jobs: pwsh: true ScriptType: InlineScript inline: | + Write-Host "##[group]Deploy [${{ deploymentBlock.path }}] via connection [${{ parameters.serviceConnection }}]" + # Load used functions . (Join-Path '$(moduleRepoRoot)' '$(pipelineFunctionsPath)' 'resourceDeployment' 'New-ModuleDeployment.ps1') @@ -295,6 +313,8 @@ jobs: throw $res.exception } + Write-Host "##[endgroup]" + # [Removal] task(s) #------------------ - task: AzurePowerShell@5 @@ -308,6 +328,8 @@ jobs: failOnStandardError: false pwsh: true inline: | + Write-Host "##[group]Remove deployed resources via [${{ parameters.serviceConnection }}]" + # Load used function . (Join-Path '$(moduleRepoRoot)' '$(pipelineFunctionsPath)' 'resourceRemoval' 'Initialize-DeploymentRemoval.ps1') @@ -334,3 +356,5 @@ jobs: Initialize-DeploymentRemoval @functionInput } + + Write-Host "##[endgroup]" diff --git a/.azuredevops/pipelineTemplates/jobs.validateModulePester.yml b/.azuredevops/pipelineTemplates/jobs.validateModulePester.yml index 288ff4416d..9ce214b81e 100644 --- a/.azuredevops/pipelineTemplates/jobs.validateModulePester.yml +++ b/.azuredevops/pipelineTemplates/jobs.validateModulePester.yml @@ -91,6 +91,8 @@ jobs: targetType: inline pwsh: true script: | + Write-Host "##[group]Handle Multi-Repo Invocation" + # Handle multiple-repositories if( "${{ join(';',parameters.checkoutRepositories) }}".length -gt 0) { Write-Verbose "Multi-Repo Checkout" -Verbose @@ -104,6 +106,8 @@ jobs: Write-Host "##vso[task.setvariable variable=ModuleRepoRoot]$moduleRepoRoot" Write-Host "##vso[task.setvariable variable=ParametersRepoRoot]$parametersRepoRoot" + Write-Host "##[endgroup]" + # [Agent] Prepare environment #---------------------------- - task: PowerShell@2 @@ -112,6 +116,8 @@ jobs: targetType: inline pwsh: true script: | + Write-Host "##[group]Setup agent" + # Load used functions . (Join-Path '$(moduleRepoRoot)' 'utilities' 'pipelines' 'sharedScripts' 'Set-EnvironmentOnAgent.ps1') @@ -125,6 +131,8 @@ jobs: # Set agent up Set-EnvironmentOnAgent -PSModules $Modules + Write-Host "##[endgroup]" + # [Module Pester Test] task(s) #----------------------------- - task: AzurePowerShell@5 @@ -136,6 +144,8 @@ jobs: ScriptType: InlineScript pwsh: true inline: | + Write-Host "##[group]Run general tests via (Pester) via connection [${{ parameters.serviceConnection }}]" + $moduleFolderPaths = @(Join-Path '$(moduleRepoRoot)' '${{ parameters.modulePath }}') $moduleFolderPaths += (Get-ChildItem $moduleFolderPaths -Recurse -Directory -Force).FullName | Where-Object { (Get-ChildItem $_ -File -Depth 0 -Include @('deploy.json', 'deploy.bicep') -Force).Count -gt 0 @@ -164,6 +174,8 @@ jobs: Verbosity = 'Detailed' } } -ErrorAction 'Stop' + + Write-Host "##[endgroup]" errorActionPreference: continue - task: PublishTestResults@2 @@ -203,6 +215,8 @@ jobs: targetType: inline pwsh: true script: | + Write-Host "##[group]Handle Multi-Repo Invocation" + # Handle multiple-repositories if( "${{ join(';',parameters.checkoutRepositories) }}".length -gt 0) { Write-Verbose "Multi-Repo Checkout" -Verbose @@ -216,6 +230,8 @@ jobs: Write-Host "##vso[task.setvariable variable=ModuleRepoRoot]$moduleRepoRoot" Write-Host "##vso[task.setvariable variable=ParametersRepoRoot]$parametersRepoRoot" + Write-Host "##[endgroup]" + # [Agent] Prepare environment #---------------------------- - task: PowerShell@2 @@ -224,12 +240,16 @@ jobs: targetType: inline pwsh: true script: | + Write-Host "##[group]Setup agent" + # Load used functions . (Join-Path '$(moduleRepoRoot)' 'utilities' 'pipelines' 'sharedScripts' 'Set-EnvironmentOnAgent.ps1') # Set agent up Set-EnvironmentOnAgent + Write-Host "##[endgroup]" + # [Module Pester Test] task(s) #----------------------------- - task: AzurePowerShell@5 @@ -241,6 +261,8 @@ jobs: ScriptType: InlineScript pwsh: true inline: | + Write-Host "##[group]Run API tests via (Pester) via connection [${{ parameters.serviceConnection }}]" + $moduleFolderPaths = @(Join-Path '$(moduleRepoRoot)' '${{ parameters.modulePath }}') $moduleFolderPaths += (Get-ChildItem $moduleFolderPaths -Recurse -Directory -Force).FullName | Where-Object { (Get-ChildItem $_ -File -Depth 0 -Include @('deploy.json', 'deploy.bicep') -Force).Count -gt 0 @@ -269,6 +291,8 @@ jobs: Verbosity = 'Detailed' } } -ErrorAction 'Stop' + + Write-Host "##[endgroup]" errorActionPreference: continue - task: PublishTestResults@2 diff --git a/.github/actions/templates/getWorkflowInput/action.yml b/.github/actions/templates/getWorkflowInput/action.yml index 398f57d545..627497dfbf 100644 --- a/.github/actions/templates/getWorkflowInput/action.yml +++ b/.github/actions/templates/getWorkflowInput/action.yml @@ -17,6 +17,9 @@ runs: - name: Get workflow input parameters id: get-input-param-action run: | + # Get workflow input parameters + Write-Host "::group::Get workflow input parameters" + Write-Verbose "The workflow trigger is: ${{ github.event_name }}" -Verbose # When running from workflow_dispatch event get input values @@ -41,5 +44,7 @@ runs: } # Output values to be accessed by next jobs - Write-Output "::set-output name=removeDeployment::$removeDeployment" + Write-Host "::set-output name=removeDeployment::$removeDeployment" + + Write-Host "::endgroup::" shell: pwsh diff --git a/.github/actions/templates/publishModule/action.yml b/.github/actions/templates/publishModule/action.yml index 3610e9c40c..f29bb83644 100644 --- a/.github/actions/templates/publishModule/action.yml +++ b/.github/actions/templates/publishModule/action.yml @@ -38,6 +38,9 @@ runs: - name: 'Setup agent' shell: pwsh run: | + # Setup agent + Write-Host "::group::Setup agent" + # Load used functions . (Join-Path $env:GITHUB_WORKSPACE 'utilities' 'pipelines' 'sharedScripts' 'Set-EnvironmentOnAgent.ps1') @@ -51,6 +54,8 @@ runs: # Set agent up Set-EnvironmentOnAgent -PSModules $Modules + Write-Host "::endgroup::" + - name: Azure Login uses: Azure/login@v1 with: @@ -61,6 +66,9 @@ runs: shell: pwsh if: ${{ inputs.templateSpecsDoPublish == 'true' }} run: | + # Publish module to template specs + Write-Host "::group::Publish module to template specs" + # Load used functions . (Join-Path $env:GITHUB_WORKSPACE 'utilities' 'pipelines' 'resourcePublish' 'Get-ModulesToUpdate.ps1') . (Join-Path $env:GITHUB_WORKSPACE 'utilities' 'pipelines' 'resourcePublish' 'Publish-ModuleToTemplateSpec.ps1') @@ -77,6 +85,7 @@ runs: # Publish the modified child resources foreach ($ModuleToUpdate in $ModulesToUpdate) { + Write-Host "::group::- $($ModuleToUpdate.TemplateFilePath)" $functionInput = @{ TemplateFilePath = $ModuleToUpdate.TemplateFilePath TemplateSpecsRgName = '${{ inputs.templateSpecsRgName }}' @@ -95,6 +104,8 @@ runs: shell: pwsh if: ${{ inputs.bicepRegistryDoPublish == 'true' }} run: | + # Publish module to private bicep registry + Write-Host "::group::Publish module to private bicep registry" # Load used functions . (Join-Path $env:GITHUB_WORKSPACE 'utilities' 'pipelines' 'resourcePublish' 'Get-ModulesToUpdate.ps1') . (Join-Path $env:GITHUB_WORKSPACE 'utilities' 'pipelines' 'resourcePublish' 'Publish-ModuleToPrivateBicepRegistry.ps1') @@ -111,6 +122,7 @@ runs: # Publish the modified child resources foreach ($ModuleToUpdate in $ModulesToUpdate) { + Write-Host "::group::- $($ModuleToUpdate.TemplateFilePath)" $functionInput = @{ TemplateFilePath = $ModuleToUpdate.TemplateFilePath BicepRegistryName = '${{ inputs.bicepRegistryName }}' diff --git a/.github/actions/templates/validateModuleDeployment/action.yml b/.github/actions/templates/validateModuleDeployment/action.yml index 956635b4d9..cf734b181f 100644 --- a/.github/actions/templates/validateModuleDeployment/action.yml +++ b/.github/actions/templates/validateModuleDeployment/action.yml @@ -41,6 +41,9 @@ runs: - name: 'Setup agent' shell: pwsh run: | + # Setup agent + Write-Host "::group::Setup agent" + # Load used functions . (Join-Path $env:GITHUB_WORKSPACE 'utilities' 'pipelines' 'sharedScripts' 'Set-EnvironmentOnAgent.ps1') @@ -64,6 +67,9 @@ runs: # Set agent up Set-EnvironmentOnAgent -PSModules $Modules + + Write-Host "::endgroup::" + - name: Azure Login uses: Azure/login@v1 with: @@ -75,6 +81,9 @@ runs: - name: 'Replace Parameter File Tokens [${{ inputs.parameterFilePath }}] ' shell: pwsh run: | + # Replace Parameter File Tokens [${{ inputs.parameterFilePath }}] + Write-Host "::group::Replace Parameter File Tokens [${{ inputs.parameterFilePath }}]" + # Load used functions . (Join-Path $env:GITHUB_WORKSPACE 'utilities' 'pipelines' 'tokensReplacement' 'Convert-TokensInParameterFile.ps1') @@ -105,11 +114,16 @@ runs: # Invoke Token Replacement Functionality $null = Convert-TokensInParameterFile @ConvertTokensInputs -Verbose + Write-Host "::endgroup::" + # [Deployment validation] task(s) # ------------------------------- - name: 'Validate [${{ inputs.templateFilePath }}]' shell: pwsh run: | + # Validate [${{ inputs.templateFilePath }}] + Write-Host "::group::Validate [${{ inputs.templateFilePath }}]" + # Load used functions . (Join-Path $env:GITHUB_WORKSPACE 'utilities' 'pipelines' 'resourceValidation' 'Test-TemplateWithParameterFile.ps1') @@ -130,12 +144,17 @@ runs: Test-TemplateWithParameterFile @functionInput -Verbose + Write-Host "::endgroup::" + # [Deployment execution] task(s) # ------------------------------ - name: 'Deploy [${{ inputs.templateFilePath }}] with parameters [${{ inputs.parameterFilePath }}]' shell: pwsh id: deploy_step run: | + # Deploy [${{ inputs.templateFilePath }}] with parameters [${{ inputs.parameterFilePath }}] + Write-Host "::group::Deploy [${{ inputs.templateFilePath }}] with parameters [${{ inputs.parameterFilePath }}]" + # Load used functions . (Join-Path $env:GITHUB_WORKSPACE 'utilities' 'pipelines' 'resourceDeployment' 'New-ModuleDeployment.ps1') @@ -175,12 +194,17 @@ runs: throw $res.exception } + Write-Host "::endgroup::" + # [Deployment removal] task(s) # ---------------------------- - name: 'Remove [${{ inputs.templateFilePath }}] from parameters [${{ inputs.parameterFilePath }}]' shell: pwsh if: ${{ always() && inputs.removeDeployment == 'true' && steps.deploy_step.outputs.deploymentName != '' }} run: | + # Remove [${{ inputs.templateFilePath }}] from parameters [${{ inputs.parameterFilePath }}] + Write-Host "::group::Remove [${{ inputs.templateFilePath }}] from parameters [${{ inputs.parameterFilePath }}]" + # Load used function . (Join-Path $env:GITHUB_WORKSPACE 'utilities' 'pipelines' 'resourceRemoval' 'Initialize-DeploymentRemoval.ps1') @@ -198,3 +222,5 @@ runs: Initialize-DeploymentRemoval @functionInput } + + Write-Host "::endgroup::" diff --git a/.github/actions/templates/validateModulePester/action.yml b/.github/actions/templates/validateModulePester/action.yml index 1bb6c5d7a8..f7543d6ab6 100644 --- a/.github/actions/templates/validateModulePester/action.yml +++ b/.github/actions/templates/validateModulePester/action.yml @@ -13,6 +13,9 @@ runs: - name: 'Setup agent' shell: pwsh run: | + # Setup agent + Write-Host "::group::Setup agent" + # Load used functions . (Join-Path $env:GITHUB_WORKSPACE 'utilities' 'pipelines' 'sharedScripts' 'Set-EnvironmentOnAgent.ps1') @@ -26,6 +29,8 @@ runs: # Set agent up Set-EnvironmentOnAgent -PSModules $Modules + Write-Host "::endgroup::" + - name: Azure Login uses: Azure/login@v1 with: @@ -38,6 +43,9 @@ runs: id: pester_run_step shell: pwsh run: | + # Run global tests via Pester + Write-Host "::group::Run global tests via Pester" + $moduleFolderPaths = @(Join-Path $env:GITHUB_WORKSPACE "${{ inputs.modulePath }}") $moduleFolderPaths += (Get-ChildItem $moduleFolderPaths -Recurse -Directory -Force).FullName | Where-Object { (Get-ChildItem $_ -File -Depth 0 -Include @('deploy.json', 'deploy.bicep') -Force).Count -gt 0 @@ -70,6 +78,8 @@ runs: } } + Write-Host "::endgroup::" + - name: Publish Test Results uses: EnricoMi/publish-unit-test-result-action@v1 if: always() && !contains('cancelled,skipped', steps.pester_run_step.outcome) @@ -83,6 +93,9 @@ runs: if: always() shell: pwsh run: | + # Run API tests via Pester + Write-Host "::group::Run API tests via Pester" + $moduleFolderPaths = @(Join-Path $env:GITHUB_WORKSPACE "${{ inputs.modulePath }}") $moduleFolderPaths += (Get-ChildItem $moduleFolderPaths -Recurse -Directory -Force).FullName | Where-Object { (Get-ChildItem $_ -File -Depth 0 -Include @('deploy.json', 'deploy.bicep') -Force).Count -gt 0 @@ -115,6 +128,8 @@ runs: } } + Write-Host "::endgroup::" + - name: Publish Test Results uses: EnricoMi/publish-unit-test-result-action@v1 if: always() && !contains('cancelled,skipped', steps.pester_api_run_step.outcome) From 9a1a678c961a85acfbce2dcbe7d38bdd3b89dd8d Mon Sep 17 00:00:00 2001 From: Marius Date: Sun, 6 Feb 2022 13:25:25 +0100 Subject: [PATCH 2/6] Align to use Write-Output --- .../pipelineTemplates/jobs.publishModule.yml | 36 +++++++++---------- .../jobs.validateModuleDeployment.yml | 28 +++++++-------- .../jobs.validateModulePester.yml | 32 ++++++++--------- .../templates/getWorkflowInput/action.yml | 6 ++-- .../templates/publishModule/action.yml | 12 +++---- .../validateModuleDeployment/action.yml | 20 +++++------ .../templates/validateModulePester/action.yml | 12 +++---- 7 files changed, 73 insertions(+), 73 deletions(-) diff --git a/.azuredevops/pipelineTemplates/jobs.publishModule.yml b/.azuredevops/pipelineTemplates/jobs.publishModule.yml index 81ecf26e13..e6601bb596 100644 --- a/.azuredevops/pipelineTemplates/jobs.publishModule.yml +++ b/.azuredevops/pipelineTemplates/jobs.publishModule.yml @@ -106,7 +106,7 @@ jobs: targetType: inline pwsh: true script: | - Write-Host "##[group]Setup agent" + Write-Output "##[group]Setup agent" # Load used functions . (Join-Path '$(System.DefaultWorkingDirectory)' 'utilities' 'pipelines' 'sharedScripts' 'Set-EnvironmentOnAgent.ps1') @@ -121,7 +121,7 @@ jobs: # Set agent up Set-EnvironmentOnAgent -PSModules $Modules - Write-Host "##[endgroup]" + Write-Output "##[endgroup]" # [Multi Repo] Support task #-------------------------- @@ -131,7 +131,7 @@ jobs: targetType: inline pwsh: true script: | - Write-Host "##[group]Handle Multi-Repo Invocation" + Write-Output "##[group]Handle Multi-Repo Invocation" # ---------------------------- # # HANDLE MULTI-REPO INVOCATION # @@ -145,9 +145,9 @@ jobs: Write-Verbose "No Multi-Repo Checkout" -Verbose $modulePath = Join-Path '$(System.DefaultWorkingDirectory)' '${{ parameters.modulePath }}' } - Write-Host "##vso[task.setvariable variable=ENVMODULEPATH]$modulePath" + Write-Output "##vso[task.setvariable variable=ENVMODULEPATH]$modulePath" - Write-Host "##[endgroup]" + Write-Output "##[endgroup]" # [Universal Artifact-feed publish] task(s) #------------------------------------------ @@ -162,7 +162,7 @@ jobs: targetType: inline pwsh: true script: | - Write-Host "##[group]Publish module to artifacts feed" + Write-Output "##[group]Publish module to artifacts feed" # Load used functions . (Join-Path '$(System.DefaultWorkingDirectory)' '$(pipelineFunctionsPath)' 'resourcePublish' 'Get-ModulesToUpdate.ps1') @@ -184,11 +184,11 @@ jobs: # Get the modified child resources $ModulesToUpdate = Get-ModulesToUpdate @functionInput -Verbose - Write-Host "##[endgroup]" + Write-Output "##[endgroup]" # Publish the modified child resources foreach ($ModuleToUpdate in $ModulesToUpdate) { - Write-Host "##[group]- $($ModuleToUpdate.TemplateFilePath)" + Write-Output "##[group]- $($ModuleToUpdate.TemplateFilePath)" $functionInput = @{ TemplateFilePath = $ModuleToUpdate.TemplateFilePath @@ -204,7 +204,7 @@ jobs: Publish-ModuleToUniversalArtifactFeed @functionInput -Verbose - Write-Host "##[endgroup]" + Write-Output "##[endgroup]" } env: TOKEN: $(vstsFeedToken) @@ -225,7 +225,7 @@ jobs: pwsh: true ScriptType: InlineScript inline: | - Write-Host "##[group]Publish module to template specs" + Write-Output "##[group]Publish module to template specs" # Load used functions . (Join-Path '$(System.DefaultWorkingDirectory)' '$(pipelineFunctionsPath)' 'resourcePublish' 'Get-ModulesToUpdate.ps1') @@ -247,11 +247,11 @@ jobs: # Get the modified child resources $ModulesToUpdate = Get-ModulesToUpdate @functionInput -Verbose - Write-Host "##[endgroup]" + Write-Output "##[endgroup]" # Publish the modified child resources foreach ($ModuleToUpdate in $ModulesToUpdate) { - Write-Host "##[group]- $($ModuleToUpdate.TemplateFilePath)" + Write-Output "##[group]- $($ModuleToUpdate.TemplateFilePath)" $functionInput = @{ TemplateFilePath = $ModuleToUpdate.TemplateFilePath @@ -266,7 +266,7 @@ jobs: Publish-ModuleToTemplateSpec @functionInput -Verbose - Write-Host "##[endgroup]" + Write-Output "##[endgroup]" } # [private bicep registry publish] task(s) @@ -285,7 +285,7 @@ jobs: pwsh: true ScriptType: InlineScript inline: | - Write-Host "##[group]Publish module to private bicep registry" + Write-Output "##[group]Publish module to private bicep registry" # Load used functions . (Join-Path '$(System.DefaultWorkingDirectory)' '$(pipelineFunctionsPath)' 'resourcePublish' 'Get-ModulesToUpdate.ps1') @@ -307,11 +307,11 @@ jobs: # Get the modified child resources $ModulesToUpdate = Get-ModulesToUpdate @functionInput -Verbose - Write-Host "##[endgroup]" + Write-Output "##[endgroup]" # Publish the modified child resources foreach ($ModuleToUpdate in $ModulesToUpdate) { - Write-Host "##[group]- $($ModuleToUpdate.TemplateFilePath)" + Write-Output "##[group]- $($ModuleToUpdate.TemplateFilePath)" $functionInput = @{ TemplateFilePath = $ModuleToUpdate.TemplateFilePath @@ -325,6 +325,6 @@ jobs: Write-Verbose ($functionInput | ConvertTo-Json | Out-String) -Verbose Publish-ModuleToPrivateBicepRegistry @functionInput -Verbose - - Write-Host "##[endgroup]" + + Write-Output "##[endgroup]" } diff --git a/.azuredevops/pipelineTemplates/jobs.validateModuleDeployment.yml b/.azuredevops/pipelineTemplates/jobs.validateModuleDeployment.yml index 38354f179b..13b7bab600 100644 --- a/.azuredevops/pipelineTemplates/jobs.validateModuleDeployment.yml +++ b/.azuredevops/pipelineTemplates/jobs.validateModuleDeployment.yml @@ -105,7 +105,7 @@ jobs: targetType: inline pwsh: true script: | - Write-Host "##[group]Setup agent" + Write-Output "##[group]Setup agent" # Load used functions . (Join-Path '$(System.DefaultWorkingDirectory)' 'utilities' 'pipelines' 'sharedScripts' 'Set-EnvironmentOnAgent.ps1') @@ -131,7 +131,7 @@ jobs: # Set agent up Set-EnvironmentOnAgent -PSModules $Modules - Write-Host "##[endgroup]" + Write-Output "##[endgroup]" # [Multi Repo] Support task #-------------------------- @@ -141,7 +141,7 @@ jobs: targetType: inline pwsh: true script: | - Write-Host "##[group]Handle Multi-Repo Invocation" + Write-Output "##[group]Handle Multi-Repo Invocation" # Handle multiple-repositories if( "${{ join(';',parameters.checkoutRepositories) }}".length -gt 0) { @@ -153,10 +153,10 @@ jobs: $moduleRepoRoot = '$(System.DefaultWorkingDirectory)' $parametersRepoRoot = '$(System.DefaultWorkingDirectory)' } - Write-Host "##vso[task.setvariable variable=ModuleRepoRoot]$moduleRepoRoot" - Write-Host "##vso[task.setvariable variable=parametersRepoRoot]$parametersRepoRoot" + Write-Output "##vso[task.setvariable variable=ModuleRepoRoot]$moduleRepoRoot" + Write-Output "##vso[task.setvariable variable=parametersRepoRoot]$parametersRepoRoot" - Write-Host "##[endgroup]" + Write-Output "##[endgroup]" # [Agent] Replace tokens #----------------------- @@ -169,7 +169,7 @@ jobs: ScriptType: InlineScript pwsh: true inline: | - Write-Host "##[group]Replace Tokens [${{ deploymentBlock.path }}] via connection [${{ parameters.serviceConnection }}]" + Write-Output "##[group]Replace Tokens [${{ deploymentBlock.path }}] via connection [${{ parameters.serviceConnection }}]" # Load used functions . (Join-Path '$(moduleRepoRoot)' 'utilities' 'pipelines' 'tokensReplacement' 'Convert-TokensInParameterFile.ps1') @@ -202,7 +202,7 @@ jobs: # Invoke Token Replacement Functionality $null = Convert-TokensInParameterFile @ConvertTokensInputs -Verbose - Write-Host "##[endgroup]" + Write-Output "##[endgroup]" # [Validation] task(s) #--------------------- @@ -215,7 +215,7 @@ jobs: ScriptType: InlineScript pwsh: true inline: | - Write-Host "##[group]Validate [${{ deploymentBlock.path }}] via connection [${{ parameters.serviceConnection }}]" + Write-Output "##[group]Validate [${{ deploymentBlock.path }}] via connection [${{ parameters.serviceConnection }}]" # Load used functions . (Join-Path '$(moduleRepoRoot)' '$(pipelineFunctionsPath)' 'resourceValidation' 'Test-TemplateWithParameterFile.ps1') @@ -246,7 +246,7 @@ jobs: Test-TemplateWithParameterFile @functionInput -Verbose - Write-Host "##[endgroup]" + Write-Output "##[endgroup]" # [Deployment] task(s) #--------------------- @@ -260,7 +260,7 @@ jobs: pwsh: true ScriptType: InlineScript inline: | - Write-Host "##[group]Deploy [${{ deploymentBlock.path }}] via connection [${{ parameters.serviceConnection }}]" + Write-Output "##[group]Deploy [${{ deploymentBlock.path }}] via connection [${{ parameters.serviceConnection }}]" # Load used functions . (Join-Path '$(moduleRepoRoot)' '$(pipelineFunctionsPath)' 'resourceDeployment' 'New-ModuleDeployment.ps1') @@ -313,7 +313,7 @@ jobs: throw $res.exception } - Write-Host "##[endgroup]" + Write-Output "##[endgroup]" # [Removal] task(s) #------------------ @@ -328,7 +328,7 @@ jobs: failOnStandardError: false pwsh: true inline: | - Write-Host "##[group]Remove deployed resources via [${{ parameters.serviceConnection }}]" + Write-Output "##[group]Remove deployed resources via [${{ parameters.serviceConnection }}]" # Load used function . (Join-Path '$(moduleRepoRoot)' '$(pipelineFunctionsPath)' 'resourceRemoval' 'Initialize-DeploymentRemoval.ps1') @@ -357,4 +357,4 @@ jobs: Initialize-DeploymentRemoval @functionInput } - Write-Host "##[endgroup]" + Write-Output "##[endgroup]" diff --git a/.azuredevops/pipelineTemplates/jobs.validateModulePester.yml b/.azuredevops/pipelineTemplates/jobs.validateModulePester.yml index 9ce214b81e..48fa7689f8 100644 --- a/.azuredevops/pipelineTemplates/jobs.validateModulePester.yml +++ b/.azuredevops/pipelineTemplates/jobs.validateModulePester.yml @@ -91,7 +91,7 @@ jobs: targetType: inline pwsh: true script: | - Write-Host "##[group]Handle Multi-Repo Invocation" + Write-Output "##[group]Handle Multi-Repo Invocation" # Handle multiple-repositories if( "${{ join(';',parameters.checkoutRepositories) }}".length -gt 0) { @@ -103,10 +103,10 @@ jobs: $moduleRepoRoot = '$(System.DefaultWorkingDirectory)' $parametersRepoRoot = '$(System.DefaultWorkingDirectory)' } - Write-Host "##vso[task.setvariable variable=ModuleRepoRoot]$moduleRepoRoot" - Write-Host "##vso[task.setvariable variable=ParametersRepoRoot]$parametersRepoRoot" + Write-Output "##vso[task.setvariable variable=ModuleRepoRoot]$moduleRepoRoot" + Write-Output "##vso[task.setvariable variable=ParametersRepoRoot]$parametersRepoRoot" - Write-Host "##[endgroup]" + Write-Output "##[endgroup]" # [Agent] Prepare environment #---------------------------- @@ -116,7 +116,7 @@ jobs: targetType: inline pwsh: true script: | - Write-Host "##[group]Setup agent" + Write-Output "##[group]Setup agent" # Load used functions . (Join-Path '$(moduleRepoRoot)' 'utilities' 'pipelines' 'sharedScripts' 'Set-EnvironmentOnAgent.ps1') @@ -131,7 +131,7 @@ jobs: # Set agent up Set-EnvironmentOnAgent -PSModules $Modules - Write-Host "##[endgroup]" + Write-Output "##[endgroup]" # [Module Pester Test] task(s) #----------------------------- @@ -144,7 +144,7 @@ jobs: ScriptType: InlineScript pwsh: true inline: | - Write-Host "##[group]Run general tests via (Pester) via connection [${{ parameters.serviceConnection }}]" + Write-Output "##[group]Run general tests via (Pester) via connection [${{ parameters.serviceConnection }}]" $moduleFolderPaths = @(Join-Path '$(moduleRepoRoot)' '${{ parameters.modulePath }}') $moduleFolderPaths += (Get-ChildItem $moduleFolderPaths -Recurse -Directory -Force).FullName | Where-Object { @@ -175,7 +175,7 @@ jobs: } } -ErrorAction 'Stop' - Write-Host "##[endgroup]" + Write-Output "##[endgroup]" errorActionPreference: continue - task: PublishTestResults@2 @@ -215,7 +215,7 @@ jobs: targetType: inline pwsh: true script: | - Write-Host "##[group]Handle Multi-Repo Invocation" + Write-Output "##[group]Handle Multi-Repo Invocation" # Handle multiple-repositories if( "${{ join(';',parameters.checkoutRepositories) }}".length -gt 0) { @@ -227,10 +227,10 @@ jobs: $moduleRepoRoot = '$(System.DefaultWorkingDirectory)' $parametersRepoRoot = '$(System.DefaultWorkingDirectory)' } - Write-Host "##vso[task.setvariable variable=ModuleRepoRoot]$moduleRepoRoot" - Write-Host "##vso[task.setvariable variable=ParametersRepoRoot]$parametersRepoRoot" + Write-Output "##vso[task.setvariable variable=ModuleRepoRoot]$moduleRepoRoot" + Write-Output "##vso[task.setvariable variable=ParametersRepoRoot]$parametersRepoRoot" - Write-Host "##[endgroup]" + Write-Output "##[endgroup]" # [Agent] Prepare environment #---------------------------- @@ -240,7 +240,7 @@ jobs: targetType: inline pwsh: true script: | - Write-Host "##[group]Setup agent" + Write-Output "##[group]Setup agent" # Load used functions . (Join-Path '$(moduleRepoRoot)' 'utilities' 'pipelines' 'sharedScripts' 'Set-EnvironmentOnAgent.ps1') @@ -248,7 +248,7 @@ jobs: # Set agent up Set-EnvironmentOnAgent - Write-Host "##[endgroup]" + Write-Output "##[endgroup]" # [Module Pester Test] task(s) #----------------------------- @@ -261,7 +261,7 @@ jobs: ScriptType: InlineScript pwsh: true inline: | - Write-Host "##[group]Run API tests via (Pester) via connection [${{ parameters.serviceConnection }}]" + Write-Output "##[group]Run API tests via (Pester) via connection [${{ parameters.serviceConnection }}]" $moduleFolderPaths = @(Join-Path '$(moduleRepoRoot)' '${{ parameters.modulePath }}') $moduleFolderPaths += (Get-ChildItem $moduleFolderPaths -Recurse -Directory -Force).FullName | Where-Object { @@ -292,7 +292,7 @@ jobs: } } -ErrorAction 'Stop' - Write-Host "##[endgroup]" + Write-Output "##[endgroup]" errorActionPreference: continue - task: PublishTestResults@2 diff --git a/.github/actions/templates/getWorkflowInput/action.yml b/.github/actions/templates/getWorkflowInput/action.yml index 627497dfbf..3a4a1799b0 100644 --- a/.github/actions/templates/getWorkflowInput/action.yml +++ b/.github/actions/templates/getWorkflowInput/action.yml @@ -18,7 +18,7 @@ runs: id: get-input-param-action run: | # Get workflow input parameters - Write-Host "::group::Get workflow input parameters" + Write-Output "::group::Get workflow input parameters" Write-Verbose "The workflow trigger is: ${{ github.event_name }}" -Verbose @@ -44,7 +44,7 @@ runs: } # Output values to be accessed by next jobs - Write-Host "::set-output name=removeDeployment::$removeDeployment" + Write-Output "::set-output name=removeDeployment::$removeDeployment" - Write-Host "::endgroup::" + Write-Output "::endgroup::" shell: pwsh diff --git a/.github/actions/templates/publishModule/action.yml b/.github/actions/templates/publishModule/action.yml index f29bb83644..b24df1b69d 100644 --- a/.github/actions/templates/publishModule/action.yml +++ b/.github/actions/templates/publishModule/action.yml @@ -39,7 +39,7 @@ runs: shell: pwsh run: | # Setup agent - Write-Host "::group::Setup agent" + Write-Output "::group::Setup agent" # Load used functions . (Join-Path $env:GITHUB_WORKSPACE 'utilities' 'pipelines' 'sharedScripts' 'Set-EnvironmentOnAgent.ps1') @@ -54,7 +54,7 @@ runs: # Set agent up Set-EnvironmentOnAgent -PSModules $Modules - Write-Host "::endgroup::" + Write-Output "::endgroup::" - name: Azure Login uses: Azure/login@v1 @@ -67,7 +67,7 @@ runs: if: ${{ inputs.templateSpecsDoPublish == 'true' }} run: | # Publish module to template specs - Write-Host "::group::Publish module to template specs" + Write-Output "::group::Publish module to template specs" # Load used functions . (Join-Path $env:GITHUB_WORKSPACE 'utilities' 'pipelines' 'resourcePublish' 'Get-ModulesToUpdate.ps1') @@ -85,7 +85,7 @@ runs: # Publish the modified child resources foreach ($ModuleToUpdate in $ModulesToUpdate) { - Write-Host "::group::- $($ModuleToUpdate.TemplateFilePath)" + Write-Output "::group::- $($ModuleToUpdate.TemplateFilePath)" $functionInput = @{ TemplateFilePath = $ModuleToUpdate.TemplateFilePath TemplateSpecsRgName = '${{ inputs.templateSpecsRgName }}' @@ -105,7 +105,7 @@ runs: if: ${{ inputs.bicepRegistryDoPublish == 'true' }} run: | # Publish module to private bicep registry - Write-Host "::group::Publish module to private bicep registry" + Write-Output "::group::Publish module to private bicep registry" # Load used functions . (Join-Path $env:GITHUB_WORKSPACE 'utilities' 'pipelines' 'resourcePublish' 'Get-ModulesToUpdate.ps1') . (Join-Path $env:GITHUB_WORKSPACE 'utilities' 'pipelines' 'resourcePublish' 'Publish-ModuleToPrivateBicepRegistry.ps1') @@ -122,7 +122,7 @@ runs: # Publish the modified child resources foreach ($ModuleToUpdate in $ModulesToUpdate) { - Write-Host "::group::- $($ModuleToUpdate.TemplateFilePath)" + Write-Output "::group::- $($ModuleToUpdate.TemplateFilePath)" $functionInput = @{ TemplateFilePath = $ModuleToUpdate.TemplateFilePath BicepRegistryName = '${{ inputs.bicepRegistryName }}' diff --git a/.github/actions/templates/validateModuleDeployment/action.yml b/.github/actions/templates/validateModuleDeployment/action.yml index cf734b181f..ca7c3b2c59 100644 --- a/.github/actions/templates/validateModuleDeployment/action.yml +++ b/.github/actions/templates/validateModuleDeployment/action.yml @@ -42,7 +42,7 @@ runs: shell: pwsh run: | # Setup agent - Write-Host "::group::Setup agent" + Write-Output "::group::Setup agent" # Load used functions . (Join-Path $env:GITHUB_WORKSPACE 'utilities' 'pipelines' 'sharedScripts' 'Set-EnvironmentOnAgent.ps1') @@ -68,7 +68,7 @@ runs: # Set agent up Set-EnvironmentOnAgent -PSModules $Modules - Write-Host "::endgroup::" + Write-Output "::endgroup::" - name: Azure Login uses: Azure/login@v1 @@ -82,7 +82,7 @@ runs: shell: pwsh run: | # Replace Parameter File Tokens [${{ inputs.parameterFilePath }}] - Write-Host "::group::Replace Parameter File Tokens [${{ inputs.parameterFilePath }}]" + Write-Output "::group::Replace Parameter File Tokens [${{ inputs.parameterFilePath }}]" # Load used functions . (Join-Path $env:GITHUB_WORKSPACE 'utilities' 'pipelines' 'tokensReplacement' 'Convert-TokensInParameterFile.ps1') @@ -114,7 +114,7 @@ runs: # Invoke Token Replacement Functionality $null = Convert-TokensInParameterFile @ConvertTokensInputs -Verbose - Write-Host "::endgroup::" + Write-Output "::endgroup::" # [Deployment validation] task(s) # ------------------------------- @@ -122,7 +122,7 @@ runs: shell: pwsh run: | # Validate [${{ inputs.templateFilePath }}] - Write-Host "::group::Validate [${{ inputs.templateFilePath }}]" + Write-Output "::group::Validate [${{ inputs.templateFilePath }}]" # Load used functions . (Join-Path $env:GITHUB_WORKSPACE 'utilities' 'pipelines' 'resourceValidation' 'Test-TemplateWithParameterFile.ps1') @@ -144,7 +144,7 @@ runs: Test-TemplateWithParameterFile @functionInput -Verbose - Write-Host "::endgroup::" + Write-Output "::endgroup::" # [Deployment execution] task(s) # ------------------------------ @@ -153,7 +153,7 @@ runs: id: deploy_step run: | # Deploy [${{ inputs.templateFilePath }}] with parameters [${{ inputs.parameterFilePath }}] - Write-Host "::group::Deploy [${{ inputs.templateFilePath }}] with parameters [${{ inputs.parameterFilePath }}]" + Write-Output "::group::Deploy [${{ inputs.templateFilePath }}] with parameters [${{ inputs.parameterFilePath }}]" # Load used functions . (Join-Path $env:GITHUB_WORKSPACE 'utilities' 'pipelines' 'resourceDeployment' 'New-ModuleDeployment.ps1') @@ -194,7 +194,7 @@ runs: throw $res.exception } - Write-Host "::endgroup::" + Write-Output "::endgroup::" # [Deployment removal] task(s) # ---------------------------- @@ -203,7 +203,7 @@ runs: if: ${{ always() && inputs.removeDeployment == 'true' && steps.deploy_step.outputs.deploymentName != '' }} run: | # Remove [${{ inputs.templateFilePath }}] from parameters [${{ inputs.parameterFilePath }}] - Write-Host "::group::Remove [${{ inputs.templateFilePath }}] from parameters [${{ inputs.parameterFilePath }}]" + Write-Output "::group::Remove [${{ inputs.templateFilePath }}] from parameters [${{ inputs.parameterFilePath }}]" # Load used function . (Join-Path $env:GITHUB_WORKSPACE 'utilities' 'pipelines' 'resourceRemoval' 'Initialize-DeploymentRemoval.ps1') @@ -223,4 +223,4 @@ runs: Initialize-DeploymentRemoval @functionInput } - Write-Host "::endgroup::" + Write-Output "::endgroup::" diff --git a/.github/actions/templates/validateModulePester/action.yml b/.github/actions/templates/validateModulePester/action.yml index f7543d6ab6..fc8268bf31 100644 --- a/.github/actions/templates/validateModulePester/action.yml +++ b/.github/actions/templates/validateModulePester/action.yml @@ -14,7 +14,7 @@ runs: shell: pwsh run: | # Setup agent - Write-Host "::group::Setup agent" + Write-Output "::group::Setup agent" # Load used functions . (Join-Path $env:GITHUB_WORKSPACE 'utilities' 'pipelines' 'sharedScripts' 'Set-EnvironmentOnAgent.ps1') @@ -29,7 +29,7 @@ runs: # Set agent up Set-EnvironmentOnAgent -PSModules $Modules - Write-Host "::endgroup::" + Write-Output "::endgroup::" - name: Azure Login uses: Azure/login@v1 @@ -44,7 +44,7 @@ runs: shell: pwsh run: | # Run global tests via Pester - Write-Host "::group::Run global tests via Pester" + Write-Output "::group::Run global tests via Pester" $moduleFolderPaths = @(Join-Path $env:GITHUB_WORKSPACE "${{ inputs.modulePath }}") $moduleFolderPaths += (Get-ChildItem $moduleFolderPaths -Recurse -Directory -Force).FullName | Where-Object { @@ -78,7 +78,7 @@ runs: } } - Write-Host "::endgroup::" + Write-Output "::endgroup::" - name: Publish Test Results uses: EnricoMi/publish-unit-test-result-action@v1 @@ -94,7 +94,7 @@ runs: shell: pwsh run: | # Run API tests via Pester - Write-Host "::group::Run API tests via Pester" + Write-Output "::group::Run API tests via Pester" $moduleFolderPaths = @(Join-Path $env:GITHUB_WORKSPACE "${{ inputs.modulePath }}") $moduleFolderPaths += (Get-ChildItem $moduleFolderPaths -Recurse -Directory -Force).FullName | Where-Object { @@ -128,7 +128,7 @@ runs: } } - Write-Host "::endgroup::" + Write-Output "::endgroup::" - name: Publish Test Results uses: EnricoMi/publish-unit-test-result-action@v1 From 35f174a6c18983e11856be83357c2b5bb0305be1 Mon Sep 17 00:00:00 2001 From: Marius Date: Mon, 7 Feb 2022 13:07:51 +0100 Subject: [PATCH 3/6] Remove accessive grouping on publish --- .../pipelineTemplates/jobs.publishModule.yml | 24 +++++-------------- .../templates/publishModule/action.yml | 13 ++++++---- 2 files changed, 14 insertions(+), 23 deletions(-) diff --git a/.azuredevops/pipelineTemplates/jobs.publishModule.yml b/.azuredevops/pipelineTemplates/jobs.publishModule.yml index e6601bb596..85b88c6f79 100644 --- a/.azuredevops/pipelineTemplates/jobs.publishModule.yml +++ b/.azuredevops/pipelineTemplates/jobs.publishModule.yml @@ -184,12 +184,8 @@ jobs: # Get the modified child resources $ModulesToUpdate = Get-ModulesToUpdate @functionInput -Verbose - Write-Output "##[endgroup]" - # Publish the modified child resources foreach ($ModuleToUpdate in $ModulesToUpdate) { - Write-Output "##[group]- $($ModuleToUpdate.TemplateFilePath)" - $functionInput = @{ TemplateFilePath = $ModuleToUpdate.TemplateFilePath VstsOrganizationUri = '${{ parameters.vstsOrganizationUri }}' @@ -203,9 +199,9 @@ jobs: Write-Verbose ($functionInput | ConvertTo-Json | Out-String) -Verbose Publish-ModuleToUniversalArtifactFeed @functionInput -Verbose - - Write-Output "##[endgroup]" } + + Write-Output "##[endgroup]" env: TOKEN: $(vstsFeedToken) @@ -247,12 +243,8 @@ jobs: # Get the modified child resources $ModulesToUpdate = Get-ModulesToUpdate @functionInput -Verbose - Write-Output "##[endgroup]" - # Publish the modified child resources foreach ($ModuleToUpdate in $ModulesToUpdate) { - Write-Output "##[group]- $($ModuleToUpdate.TemplateFilePath)" - $functionInput = @{ TemplateFilePath = $ModuleToUpdate.TemplateFilePath TemplateSpecsRgName = '${{ parameters.templateSpecsRgName }}' @@ -265,10 +257,10 @@ jobs: Write-Verbose ($functionInput | ConvertTo-Json | Out-String) -Verbose Publish-ModuleToTemplateSpec @functionInput -Verbose - - Write-Output "##[endgroup]" } + Write-Output "##[endgroup]" + # [private bicep registry publish] task(s) #------------------------------------------- - task: AzurePowerShell@5 @@ -307,12 +299,8 @@ jobs: # Get the modified child resources $ModulesToUpdate = Get-ModulesToUpdate @functionInput -Verbose - Write-Output "##[endgroup]" - # Publish the modified child resources foreach ($ModuleToUpdate in $ModulesToUpdate) { - Write-Output "##[group]- $($ModuleToUpdate.TemplateFilePath)" - $functionInput = @{ TemplateFilePath = $ModuleToUpdate.TemplateFilePath BicepRegistryName = '${{ parameters.bicepRegistryName }}' @@ -325,6 +313,6 @@ jobs: Write-Verbose ($functionInput | ConvertTo-Json | Out-String) -Verbose Publish-ModuleToPrivateBicepRegistry @functionInput -Verbose - - Write-Output "##[endgroup]" } + + Write-Output "##[endgroup]" diff --git a/.github/actions/templates/publishModule/action.yml b/.github/actions/templates/publishModule/action.yml index b24df1b69d..8ee6cc8d23 100644 --- a/.github/actions/templates/publishModule/action.yml +++ b/.github/actions/templates/publishModule/action.yml @@ -38,7 +38,7 @@ runs: - name: 'Setup agent' shell: pwsh run: | - # Setup agent + # Grouping task logs Write-Output "::group::Setup agent" # Load used functions @@ -66,7 +66,7 @@ runs: shell: pwsh if: ${{ inputs.templateSpecsDoPublish == 'true' }} run: | - # Publish module to template specs + # Grouping task logs Write-Output "::group::Publish module to template specs" # Load used functions @@ -85,7 +85,6 @@ runs: # Publish the modified child resources foreach ($ModuleToUpdate in $ModulesToUpdate) { - Write-Output "::group::- $($ModuleToUpdate.TemplateFilePath)" $functionInput = @{ TemplateFilePath = $ModuleToUpdate.TemplateFilePath TemplateSpecsRgName = '${{ inputs.templateSpecsRgName }}' @@ -100,12 +99,15 @@ runs: Publish-ModuleToTemplateSpec @functionInput -Verbose } + Write-Output "::endgroup::" + - name: 'Publish module to private bicep registry' shell: pwsh if: ${{ inputs.bicepRegistryDoPublish == 'true' }} run: | - # Publish module to private bicep registry + # Grouping task logs Write-Output "::group::Publish module to private bicep registry" + # Load used functions . (Join-Path $env:GITHUB_WORKSPACE 'utilities' 'pipelines' 'resourcePublish' 'Get-ModulesToUpdate.ps1') . (Join-Path $env:GITHUB_WORKSPACE 'utilities' 'pipelines' 'resourcePublish' 'Publish-ModuleToPrivateBicepRegistry.ps1') @@ -122,7 +124,6 @@ runs: # Publish the modified child resources foreach ($ModuleToUpdate in $ModulesToUpdate) { - Write-Output "::group::- $($ModuleToUpdate.TemplateFilePath)" $functionInput = @{ TemplateFilePath = $ModuleToUpdate.TemplateFilePath BicepRegistryName = '${{ inputs.bicepRegistryName }}' @@ -136,3 +137,5 @@ runs: Publish-ModuleToPrivateBicepRegistry @functionInput -Verbose } + + Write-Output "::endgroup::" From a754407f998223cf2a7ce6ba65a92929644cf30e Mon Sep 17 00:00:00 2001 From: Marius Date: Mon, 7 Feb 2022 13:08:22 +0100 Subject: [PATCH 4/6] Add general comments where grouping is used --- .github/actions/templates/getWorkflowInput/action.yml | 2 +- .../templates/validateModuleDeployment/action.yml | 10 +++++----- .../actions/templates/validateModulePester/action.yml | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/actions/templates/getWorkflowInput/action.yml b/.github/actions/templates/getWorkflowInput/action.yml index 3a4a1799b0..5638c99df2 100644 --- a/.github/actions/templates/getWorkflowInput/action.yml +++ b/.github/actions/templates/getWorkflowInput/action.yml @@ -17,7 +17,7 @@ runs: - name: Get workflow input parameters id: get-input-param-action run: | - # Get workflow input parameters + # Grouping task logs Write-Output "::group::Get workflow input parameters" Write-Verbose "The workflow trigger is: ${{ github.event_name }}" -Verbose diff --git a/.github/actions/templates/validateModuleDeployment/action.yml b/.github/actions/templates/validateModuleDeployment/action.yml index ca7c3b2c59..3ed0dc0a7d 100644 --- a/.github/actions/templates/validateModuleDeployment/action.yml +++ b/.github/actions/templates/validateModuleDeployment/action.yml @@ -41,7 +41,7 @@ runs: - name: 'Setup agent' shell: pwsh run: | - # Setup agent + # Grouping task logs Write-Output "::group::Setup agent" # Load used functions @@ -81,7 +81,7 @@ runs: - name: 'Replace Parameter File Tokens [${{ inputs.parameterFilePath }}] ' shell: pwsh run: | - # Replace Parameter File Tokens [${{ inputs.parameterFilePath }}] + # Grouping task logs Write-Output "::group::Replace Parameter File Tokens [${{ inputs.parameterFilePath }}]" # Load used functions @@ -121,7 +121,7 @@ runs: - name: 'Validate [${{ inputs.templateFilePath }}]' shell: pwsh run: | - # Validate [${{ inputs.templateFilePath }}] + # Grouping task logs Write-Output "::group::Validate [${{ inputs.templateFilePath }}]" # Load used functions @@ -152,7 +152,7 @@ runs: shell: pwsh id: deploy_step run: | - # Deploy [${{ inputs.templateFilePath }}] with parameters [${{ inputs.parameterFilePath }}] + # Grouping task logs Write-Output "::group::Deploy [${{ inputs.templateFilePath }}] with parameters [${{ inputs.parameterFilePath }}]" # Load used functions @@ -202,7 +202,7 @@ runs: shell: pwsh if: ${{ always() && inputs.removeDeployment == 'true' && steps.deploy_step.outputs.deploymentName != '' }} run: | - # Remove [${{ inputs.templateFilePath }}] from parameters [${{ inputs.parameterFilePath }}] + # Grouping task logs Write-Output "::group::Remove [${{ inputs.templateFilePath }}] from parameters [${{ inputs.parameterFilePath }}]" # Load used function diff --git a/.github/actions/templates/validateModulePester/action.yml b/.github/actions/templates/validateModulePester/action.yml index fc8268bf31..bc5b9c46e0 100644 --- a/.github/actions/templates/validateModulePester/action.yml +++ b/.github/actions/templates/validateModulePester/action.yml @@ -13,7 +13,7 @@ runs: - name: 'Setup agent' shell: pwsh run: | - # Setup agent + # Grouping task logs Write-Output "::group::Setup agent" # Load used functions @@ -43,7 +43,7 @@ runs: id: pester_run_step shell: pwsh run: | - # Run global tests via Pester + # Grouping task logs Write-Output "::group::Run global tests via Pester" $moduleFolderPaths = @(Join-Path $env:GITHUB_WORKSPACE "${{ inputs.modulePath }}") @@ -93,7 +93,7 @@ runs: if: always() shell: pwsh run: | - # Run API tests via Pester + # Grouping task logs Write-Output "::group::Run API tests via Pester" $moduleFolderPaths = @(Join-Path $env:GITHUB_WORKSPACE "${{ inputs.modulePath }}") From 9dc83e8e1ccafdf845b01943f5f3613b92a87302 Mon Sep 17 00:00:00 2001 From: Marius Date: Mon, 7 Feb 2022 13:11:44 +0100 Subject: [PATCH 5/6] Removed grouping on ADO --- .../pipelineTemplates/jobs.publishModule.yml | 18 -------------- .../jobs.validateModuleDeployment.yml | 22 ----------------- .../jobs.validateModulePester.yml | 24 ------------------- 3 files changed, 64 deletions(-) diff --git a/.azuredevops/pipelineTemplates/jobs.publishModule.yml b/.azuredevops/pipelineTemplates/jobs.publishModule.yml index 85b88c6f79..57a37ad2f2 100644 --- a/.azuredevops/pipelineTemplates/jobs.publishModule.yml +++ b/.azuredevops/pipelineTemplates/jobs.publishModule.yml @@ -106,8 +106,6 @@ jobs: targetType: inline pwsh: true script: | - Write-Output "##[group]Setup agent" - # Load used functions . (Join-Path '$(System.DefaultWorkingDirectory)' 'utilities' 'pipelines' 'sharedScripts' 'Set-EnvironmentOnAgent.ps1') @@ -121,7 +119,6 @@ jobs: # Set agent up Set-EnvironmentOnAgent -PSModules $Modules - Write-Output "##[endgroup]" # [Multi Repo] Support task #-------------------------- @@ -131,8 +128,6 @@ jobs: targetType: inline pwsh: true script: | - Write-Output "##[group]Handle Multi-Repo Invocation" - # ---------------------------- # # HANDLE MULTI-REPO INVOCATION # # ---------------------------- # @@ -147,8 +142,6 @@ jobs: } Write-Output "##vso[task.setvariable variable=ENVMODULEPATH]$modulePath" - Write-Output "##[endgroup]" - # [Universal Artifact-feed publish] task(s) #------------------------------------------ - task: PowerShell@2 @@ -162,8 +155,6 @@ jobs: targetType: inline pwsh: true script: | - Write-Output "##[group]Publish module to artifacts feed" - # Load used functions . (Join-Path '$(System.DefaultWorkingDirectory)' '$(pipelineFunctionsPath)' 'resourcePublish' 'Get-ModulesToUpdate.ps1') . (Join-Path '$(System.DefaultWorkingDirectory)' '$(pipelineFunctionsPath)' 'resourcePublish' 'Publish-ModuleToUniversalArtifactFeed.ps1') @@ -201,7 +192,6 @@ jobs: Publish-ModuleToUniversalArtifactFeed @functionInput -Verbose } - Write-Output "##[endgroup]" env: TOKEN: $(vstsFeedToken) @@ -221,8 +211,6 @@ jobs: pwsh: true ScriptType: InlineScript inline: | - Write-Output "##[group]Publish module to template specs" - # Load used functions . (Join-Path '$(System.DefaultWorkingDirectory)' '$(pipelineFunctionsPath)' 'resourcePublish' 'Get-ModulesToUpdate.ps1') . (Join-Path '$(System.DefaultWorkingDirectory)' '$(pipelineFunctionsPath)' 'resourcePublish' 'Publish-ModuleToTemplateSpec.ps1') @@ -259,8 +247,6 @@ jobs: Publish-ModuleToTemplateSpec @functionInput -Verbose } - Write-Output "##[endgroup]" - # [private bicep registry publish] task(s) #------------------------------------------- - task: AzurePowerShell@5 @@ -277,8 +263,6 @@ jobs: pwsh: true ScriptType: InlineScript inline: | - Write-Output "##[group]Publish module to private bicep registry" - # Load used functions . (Join-Path '$(System.DefaultWorkingDirectory)' '$(pipelineFunctionsPath)' 'resourcePublish' 'Get-ModulesToUpdate.ps1') . (Join-Path '$(System.DefaultWorkingDirectory)' '$(pipelineFunctionsPath)' 'resourcePublish' 'Publish-ModuleToPrivateBicepRegistry.ps1') @@ -314,5 +298,3 @@ jobs: Publish-ModuleToPrivateBicepRegistry @functionInput -Verbose } - - Write-Output "##[endgroup]" diff --git a/.azuredevops/pipelineTemplates/jobs.validateModuleDeployment.yml b/.azuredevops/pipelineTemplates/jobs.validateModuleDeployment.yml index 13b7bab600..5c70be4caa 100644 --- a/.azuredevops/pipelineTemplates/jobs.validateModuleDeployment.yml +++ b/.azuredevops/pipelineTemplates/jobs.validateModuleDeployment.yml @@ -105,8 +105,6 @@ jobs: targetType: inline pwsh: true script: | - Write-Output "##[group]Setup agent" - # Load used functions . (Join-Path '$(System.DefaultWorkingDirectory)' 'utilities' 'pipelines' 'sharedScripts' 'Set-EnvironmentOnAgent.ps1') @@ -131,8 +129,6 @@ jobs: # Set agent up Set-EnvironmentOnAgent -PSModules $Modules - Write-Output "##[endgroup]" - # [Multi Repo] Support task #-------------------------- - task: PowerShell@2 @@ -141,8 +137,6 @@ jobs: targetType: inline pwsh: true script: | - Write-Output "##[group]Handle Multi-Repo Invocation" - # Handle multiple-repositories if( "${{ join(';',parameters.checkoutRepositories) }}".length -gt 0) { Write-Verbose "Multi-Repo Checkout" -Verbose @@ -156,8 +150,6 @@ jobs: Write-Output "##vso[task.setvariable variable=ModuleRepoRoot]$moduleRepoRoot" Write-Output "##vso[task.setvariable variable=parametersRepoRoot]$parametersRepoRoot" - Write-Output "##[endgroup]" - # [Agent] Replace tokens #----------------------- - task: AzurePowerShell@5 @@ -169,8 +161,6 @@ jobs: ScriptType: InlineScript pwsh: true inline: | - Write-Output "##[group]Replace Tokens [${{ deploymentBlock.path }}] via connection [${{ parameters.serviceConnection }}]" - # Load used functions . (Join-Path '$(moduleRepoRoot)' 'utilities' 'pipelines' 'tokensReplacement' 'Convert-TokensInParameterFile.ps1') @@ -202,8 +192,6 @@ jobs: # Invoke Token Replacement Functionality $null = Convert-TokensInParameterFile @ConvertTokensInputs -Verbose - Write-Output "##[endgroup]" - # [Validation] task(s) #--------------------- - task: AzurePowerShell@5 @@ -215,7 +203,6 @@ jobs: ScriptType: InlineScript pwsh: true inline: | - Write-Output "##[group]Validate [${{ deploymentBlock.path }}] via connection [${{ parameters.serviceConnection }}]" # Load used functions . (Join-Path '$(moduleRepoRoot)' '$(pipelineFunctionsPath)' 'resourceValidation' 'Test-TemplateWithParameterFile.ps1') @@ -246,8 +233,6 @@ jobs: Test-TemplateWithParameterFile @functionInput -Verbose - Write-Output "##[endgroup]" - # [Deployment] task(s) #--------------------- - task: AzurePowerShell@5 @@ -260,7 +245,6 @@ jobs: pwsh: true ScriptType: InlineScript inline: | - Write-Output "##[group]Deploy [${{ deploymentBlock.path }}] via connection [${{ parameters.serviceConnection }}]" # Load used functions . (Join-Path '$(moduleRepoRoot)' '$(pipelineFunctionsPath)' 'resourceDeployment' 'New-ModuleDeployment.ps1') @@ -313,8 +297,6 @@ jobs: throw $res.exception } - Write-Output "##[endgroup]" - # [Removal] task(s) #------------------ - task: AzurePowerShell@5 @@ -328,8 +310,6 @@ jobs: failOnStandardError: false pwsh: true inline: | - Write-Output "##[group]Remove deployed resources via [${{ parameters.serviceConnection }}]" - # Load used function . (Join-Path '$(moduleRepoRoot)' '$(pipelineFunctionsPath)' 'resourceRemoval' 'Initialize-DeploymentRemoval.ps1') @@ -356,5 +336,3 @@ jobs: Initialize-DeploymentRemoval @functionInput } - - Write-Output "##[endgroup]" diff --git a/.azuredevops/pipelineTemplates/jobs.validateModulePester.yml b/.azuredevops/pipelineTemplates/jobs.validateModulePester.yml index 48fa7689f8..beb9661412 100644 --- a/.azuredevops/pipelineTemplates/jobs.validateModulePester.yml +++ b/.azuredevops/pipelineTemplates/jobs.validateModulePester.yml @@ -91,8 +91,6 @@ jobs: targetType: inline pwsh: true script: | - Write-Output "##[group]Handle Multi-Repo Invocation" - # Handle multiple-repositories if( "${{ join(';',parameters.checkoutRepositories) }}".length -gt 0) { Write-Verbose "Multi-Repo Checkout" -Verbose @@ -106,8 +104,6 @@ jobs: Write-Output "##vso[task.setvariable variable=ModuleRepoRoot]$moduleRepoRoot" Write-Output "##vso[task.setvariable variable=ParametersRepoRoot]$parametersRepoRoot" - Write-Output "##[endgroup]" - # [Agent] Prepare environment #---------------------------- - task: PowerShell@2 @@ -116,8 +112,6 @@ jobs: targetType: inline pwsh: true script: | - Write-Output "##[group]Setup agent" - # Load used functions . (Join-Path '$(moduleRepoRoot)' 'utilities' 'pipelines' 'sharedScripts' 'Set-EnvironmentOnAgent.ps1') @@ -131,8 +125,6 @@ jobs: # Set agent up Set-EnvironmentOnAgent -PSModules $Modules - Write-Output "##[endgroup]" - # [Module Pester Test] task(s) #----------------------------- - task: AzurePowerShell@5 @@ -144,8 +136,6 @@ jobs: ScriptType: InlineScript pwsh: true inline: | - Write-Output "##[group]Run general tests via (Pester) via connection [${{ parameters.serviceConnection }}]" - $moduleFolderPaths = @(Join-Path '$(moduleRepoRoot)' '${{ parameters.modulePath }}') $moduleFolderPaths += (Get-ChildItem $moduleFolderPaths -Recurse -Directory -Force).FullName | Where-Object { (Get-ChildItem $_ -File -Depth 0 -Include @('deploy.json', 'deploy.bicep') -Force).Count -gt 0 @@ -174,8 +164,6 @@ jobs: Verbosity = 'Detailed' } } -ErrorAction 'Stop' - - Write-Output "##[endgroup]" errorActionPreference: continue - task: PublishTestResults@2 @@ -215,8 +203,6 @@ jobs: targetType: inline pwsh: true script: | - Write-Output "##[group]Handle Multi-Repo Invocation" - # Handle multiple-repositories if( "${{ join(';',parameters.checkoutRepositories) }}".length -gt 0) { Write-Verbose "Multi-Repo Checkout" -Verbose @@ -230,8 +216,6 @@ jobs: Write-Output "##vso[task.setvariable variable=ModuleRepoRoot]$moduleRepoRoot" Write-Output "##vso[task.setvariable variable=ParametersRepoRoot]$parametersRepoRoot" - Write-Output "##[endgroup]" - # [Agent] Prepare environment #---------------------------- - task: PowerShell@2 @@ -240,16 +224,12 @@ jobs: targetType: inline pwsh: true script: | - Write-Output "##[group]Setup agent" - # Load used functions . (Join-Path '$(moduleRepoRoot)' 'utilities' 'pipelines' 'sharedScripts' 'Set-EnvironmentOnAgent.ps1') # Set agent up Set-EnvironmentOnAgent - Write-Output "##[endgroup]" - # [Module Pester Test] task(s) #----------------------------- - task: AzurePowerShell@5 @@ -261,8 +241,6 @@ jobs: ScriptType: InlineScript pwsh: true inline: | - Write-Output "##[group]Run API tests via (Pester) via connection [${{ parameters.serviceConnection }}]" - $moduleFolderPaths = @(Join-Path '$(moduleRepoRoot)' '${{ parameters.modulePath }}') $moduleFolderPaths += (Get-ChildItem $moduleFolderPaths -Recurse -Directory -Force).FullName | Where-Object { (Get-ChildItem $_ -File -Depth 0 -Include @('deploy.json', 'deploy.bicep') -Force).Count -gt 0 @@ -291,8 +269,6 @@ jobs: Verbosity = 'Detailed' } } -ErrorAction 'Stop' - - Write-Output "##[endgroup]" errorActionPreference: continue - task: PublishTestResults@2 From 0a93fd2b45c189618fa5a587cbf5f5fb7bb9dc21 Mon Sep 17 00:00:00 2001 From: Marius Date: Mon, 7 Feb 2022 13:14:50 +0100 Subject: [PATCH 6/6] fix --- .azuredevops/pipelineTemplates/jobs.publishModule.yml | 2 -- .../pipelineTemplates/jobs.validateModuleDeployment.yml | 2 -- 2 files changed, 4 deletions(-) diff --git a/.azuredevops/pipelineTemplates/jobs.publishModule.yml b/.azuredevops/pipelineTemplates/jobs.publishModule.yml index 57a37ad2f2..36dc1c662a 100644 --- a/.azuredevops/pipelineTemplates/jobs.publishModule.yml +++ b/.azuredevops/pipelineTemplates/jobs.publishModule.yml @@ -119,7 +119,6 @@ jobs: # Set agent up Set-EnvironmentOnAgent -PSModules $Modules - # [Multi Repo] Support task #-------------------------- - task: PowerShell@2 @@ -191,7 +190,6 @@ jobs: Publish-ModuleToUniversalArtifactFeed @functionInput -Verbose } - env: TOKEN: $(vstsFeedToken) diff --git a/.azuredevops/pipelineTemplates/jobs.validateModuleDeployment.yml b/.azuredevops/pipelineTemplates/jobs.validateModuleDeployment.yml index 5c70be4caa..c0e95e552e 100644 --- a/.azuredevops/pipelineTemplates/jobs.validateModuleDeployment.yml +++ b/.azuredevops/pipelineTemplates/jobs.validateModuleDeployment.yml @@ -203,7 +203,6 @@ jobs: ScriptType: InlineScript pwsh: true inline: | - # Load used functions . (Join-Path '$(moduleRepoRoot)' '$(pipelineFunctionsPath)' 'resourceValidation' 'Test-TemplateWithParameterFile.ps1') @@ -245,7 +244,6 @@ jobs: pwsh: true ScriptType: InlineScript inline: | - # Load used functions . (Join-Path '$(moduleRepoRoot)' '$(pipelineFunctionsPath)' 'resourceDeployment' 'New-ModuleDeployment.ps1')