Hi ,
I was wondering how can I use Octopus.Step.Name or Octopus.Action Variable’s to Display all the steps from deployment .
My last step of deployment is PowerShell script to collect all information and post it to RabbitMQ .
Regards
Mariusz
Hi ,
I was wondering how can I use Octopus.Step.Name or Octopus.Action Variable’s to Display all the steps from deployment .
My last step of deployment is PowerShell script to collect all information and post it to RabbitMQ .
Regards
Mariusz
Hi Mariusz,
Thanks for getting in touch! It’s a bit tricky to get all the variables from PowerShell, as they’re not easily referenced. We have a bit of a snippet that will help you to get some of the values, but may require a bit of modification to get it working for your situation:
$OctopusParameters.Keys | ? {
$_ -like "Octopus.Action*"
} | % {
Write-Host "$_ : $($OctopusParameters.Item($_))"
}
The different variables that are available are listed here: http://docs.octopusdeploy.com/display/OD/System+variables
Additionally, if you don’t know about it, there is a RabbitMQ library script: https://library.octopusdeploy.com/step-template/actiontemplate-rabbitmq-notify-deploy
I hope that gets you going! If you have any further questions, let us know
Regards
Kenny
Great Thank you !!
One more Question how can I display error message that is the same as in Octopus Server Verbose display .
Those Variable below display not the same message and it’s not clear what’s the error .
Octopus.Action.Status.Error
Octopus.Action.Status.ErrorDetails
Octopus.Step.Status.Error
Octopus.step.Status.ErrorDetails
Octopus.Deployment.Error
Octopus.Deployment.ErrorDetail
example from Octopus Server Verbose :
New-Item : The file ‘C:\temp\test.txt’ already exists.
example from Variables
Octopus.Shared.Tasks.ActivityFailedException: One or more child activities failed.
Regards
Mariusz
Hi Mariusz,
Unfortunately that’s not possible. We do not store this information in variables that are available, but directly parse them to the logs.
Sorry for the bad news.
Kenny