Check in PostDeploy.ps1 that Deploy.ps1 was successful

Just like the subject line I’m looking to see how I can check in PostDeploy.ps1 that Deploy.ps1 was successful. Is there any internal octopus variable that I can check, $OctopusDeploySuccess or something?

Hi Paul,

Thanks for getting in touch! There is no such internal variable. If part of the package step fails, the step and thus deployment are considered failed and remaining conventions are skipped (such as postdeploy.ps1 would not be run). You can assume that if PostDeploy is run then Deploy was successful, you could also add your own variable for any conditional statements you have in your deploy.

As stated here:
If an item fails, the remaining items will not be executed, and instead DeployFailed.* Scripts will be found and executed.

Hope that helps!