In Email notification include machines the build package is deployed to

Hi,

First up, I would like to congratulate you on the great product you are building. As a DevOps engineer I’ve looked at several options to automate our build deployments and yours is the one we are most comfortable with.

A question - in the emails we generate post deployment, my manager would like to see if we can also get the machines to which the build package was deployed to. I checked the variable Octopus.Deployment.SpecificMachines, but this one refers to the OD ID of the machines, which doesn’t match the hostname of the machine. We’re looking for something that would quickly help us identify the machines.
I’ve also tried to assign the hostname as a variable in one of the previous PowerShell steps and then use it in the email template, but sadly that doesn’t work either.

Am I missing something or ideas on how to get this implemented are much appreciated.

Thanks!

Hi,

Thanks for reaching out! Glad to hear Octopus has become your tool of choice :slight_smile:

Unfortunately there’s no current easy way to do this without some scripting. A user outlined a way to do it with an R# script running on the Octopus Server in this post: http://help.octopusdeploy.com/discussions/questions/3455-octopusdeploymentspecificmachines-only-provides-the-octopus-id-of-a-machine-not-its-real-name

There is also a uservoice suggestion to add an out-of-the-box variable for this. If you can drop by and add some votes to it, It’ll be great: https://octopusdeploy.uservoice.com/forums/170787-general/suggestions/6584301-add-support-for-machine-name-to-show-in-deployment

Best regards,
Dalmiro

Hi Dalmiro,

thanks for the update.
With regards to your comment on the above thread:

In the meantime, you could use the following snippet which uses the function Get-OctopusMachine from the module Octoposh to resolve the names of the machines based on variable Octopus.Deployment.SpecificMachines

$IDs = $OctopusParameters[‘Octopus.Deployment.SpecificMachines’].split(",")
$names = Get-OctopusMachine -resourceOnly | ?{$_.id -in $Ids} | select -expandproperty name
$names
You can then use the content of the variable $names to build the string that you’ll pass down to Octo.exe

would this require octoposh be installed on the tentacle machine or on the octopus server?

thanks for the help,
best wishes
mayank

Hi Mayank,

That’ll be in the Octopus Server.

Cheers,
Dalmiro