Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion .azuredevops/pipelineTemplates/module.jobs.deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down Expand Up @@ -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
Expand Down
14 changes: 13 additions & 1 deletion .github/actions/templates/validateModuleDeployment/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand Down