NuGet Package Version in Variable?

Is there a way to get the NuGet Package version into a variable that I can use in a step to send an email out when the deployment is finished? I looked at the existing variables and could not find one that includes the NuGet Package version.

Thanks,
Dean

Hi Dean; Octopus 2.0 provides the variable “Octopus.Action.Package.NuGetPackageVersion” for each step - you should be able to use it like this in your email template:

We just deployed Foo version #{Octopus.Action[Foo Step].Package.NuGetPackageVersion}

I.e. you should use the step name to index the Action part of the variable.

Let me know if you have any trouble with this.

Cheers,
Nick

That worked perfectly. That option doesn’t show up in the dropdown, but I just selected “#{Octopus.Action[Foo Step].Package.NuGetPackageId}” and changed “Id” to “Version”.

Thanks for your help.

Dean

Interesting - thanks for letting us know about the dropdown.

Nick

Is this also usable with References/Dependencies? E.G. Let’s say we wanted to e-mail the used mvc and framework version

Could we do smth like this?

#{Octopus.Action[Foo Step].Microsoft.AspNet.Mvc.NuGetPackageVersion
#{Octopus.Action[Foo Step].MyFramework.NuGetPackageVersion

Hi Michiel,

Thanks for getting in touch! You would have to define the variable in the step, but then it would be available for an email step later.
See this blog post: http://octopusdeploy.com/blog/fun-with-output-variables

Note that the Octopus server is the machine that sends out the email, so you will have to define the machine name where you define the variable after Action{stepname].Output[machinename]

Hope that helps!
Vanessa