Is it possible to programmatically stop a runbook / deploy in a nice way?


Is it possible to stop a runbook / deploy in a job step (with powershell) without having the run/deploy show up as Red /Error ?

We have a check in the first job step that decides if the following steps should be run.

write-error stops the run/deploy but shows up as red/error.
exit 0 stops the step, but continues on to the next step in the runbook so that doesnt work for us.

Is there a way to make the deploy stop nicely? Showing up as green in the deploy history?

Hi Jacob,

Thanks for getting in touch!

The best option here would be through the use of Run Conditions. By using the When a variable expression evaluates to true. option you would be able to have your first step define a variable and then configure the remaining steps to only run if that value is true. Otherwise, those steps are skipped and the deployment completes successfully.

There is some additional information on the variable syntax that can be used within the Run Condition here: Variable substitutions - Octopus Deploy


This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.