diff --git a/.azuredevops/pipelineTemplates/module.jobs.deploy.yml b/.azuredevops/pipelineTemplates/module.jobs.deploy.yml index 5e517b415c..56faf474cd 100644 --- a/.azuredevops/pipelineTemplates/module.jobs.deploy.yml +++ b/.azuredevops/pipelineTemplates/module.jobs.deploy.yml @@ -231,6 +231,7 @@ jobs: #--------------------- - task: AzurePowerShell@5 displayName: 'Deploy [${{ deploymentBlock.path }}] via connection [${{ parameters.serviceConnection }}]' + name: 'DeployModule' inputs: azureSubscription: ${{ parameters.serviceConnection }} azurePowerShellVersion: ${{ parameters.azurePowerShellVersion }} @@ -273,10 +274,17 @@ jobs: Write-Host ('##vso[task.setvariable variable=deploymentName]{0}' -f $res.deploymentName) # Populate further outputs + $deploymentOutputHash=@{} + foreach ($outputKey in $res.deploymentOutput.Keys) { - Write-Output ('##vso[task.setvariable variable={0}]{1}' -f $outputKey, $res.deploymentOutput[$outputKey].Value) + Write-Output ('##vso[task.setvariable variable={0}]{1}' -f $outputKey, $res.deploymentOutput[$outputKey].Value) + $deploymentOutputHash.add($outputKey,$res.deploymentOutput[$outputKey].Value) } + $deploymentOutput = $deploymentOutputHash | ConvertTo-Json -Compress -Depth 100 + Write-Verbose "Deployment output: $deploymentOutput" -Verbose + Write-Output ('##vso[task.setvariable variable={0};isOutput=true]{1}' -f 'deploymentOutput', $deploymentOutput) + if ($res.ContainsKey('exception')) { # Happens only if there is an exception throw $res.exception diff --git a/.github/actions/templates/validateModuleDeployment/action.yml b/.github/actions/templates/validateModuleDeployment/action.yml index b1a2890b0e..8a6ae87cf1 100644 --- a/.github/actions/templates/validateModuleDeployment/action.yml +++ b/.github/actions/templates/validateModuleDeployment/action.yml @@ -25,6 +25,11 @@ inputs: default: 'true' required: false +outputs: + deploymentOutput: + description: 'The module deployment output in json format' + value: ${{ steps.deploy_step.outputs.deploymentOutput }} + runs: using: 'composite' steps: @@ -148,10 +153,17 @@ runs: Write-Output ('::set-output name={0}::{1}' -f 'deploymentName', $res.deploymentName) # Populate further outputs + $deploymentOutputHash=@{} + foreach ($outputKey in $res.deploymentOutput.Keys) { - Write-Output ('::set-output name={0}::{1}' -f $outputKey, $res.deploymentOutput[$outputKey].Value) + Write-Output ('::set-output name={0}::{1}' -f $outputKey, $res.deploymentOutput[$outputKey].Value) + $deploymentOutputHash.add($outputKey,$res.deploymentOutput[$outputKey].Value) } + $deploymentOutput = $deploymentOutputHash | ConvertTo-Json -Compress -Depth 100 + Write-Verbose "Deployment output: $deploymentOutput" -Verbose + Write-Output ('::set-output name={0}::{1}' -f 'deploymentOutput', $deploymentOutput) + if ($res.ContainsKey('exception')) { # Happens only if there is an exception throw $res.exception