I have the code below in an Email step at the end of a project, which works in a project with regular package deploy steps, however does not work as desired in a project with many multi-step package deploys.
I’m wondering: what syntax/code should be used or changed from the below code, to set the output variables properly in child steps (of a multi-deploy step).
Am thinking the action name might only look at the name of the parent step.
Thanks!
Post-deploy script in each package step:
Set-OctopusVariable -name “EmailMachine” -value #{Octopus.Machine.Name}
Set-OctopusVariable -name “PackageSkipped” -value $OctopusParameters[“Octopus.Action.Package.SkipIfAlreadyInstalled”]
Email step’s body:
#{each action in Octopus.Action}
#{if action.Package.NuGetPackageId}
#{unless Octopus.Action[#{action.Name}].Output.PackageSkipped }
Package: #{action.Package.NuGetPackageId}
version: #{action.Package.NuGetPackageVersion}
was deployed to: #{Octopus.Action[#{action.Name}].Output.Package.InstallationDirectoryPath}
on: #{Octopus.Action[#{action.Name}].Output.emailMachine}
#{/unless}
#{/if}
#{/each}