Target Deployment Server has a pending reboot

Hi Guys,

Is there a programmatic way to stop/pause a deployment if during the deployment a step detects that the server needs a reboot (this could occurre from quiet install that needs a reboot or windows patch update)?

Idealy I would like to pause the deployment where an operator will need to aknowledge the deployment condition and the release completes normally.

I could not find anything in the docs and I wonder what are your recommendations to handle this situation.

Many Thanks,
Emil

Hi Emil,

Thanks for getting in touch! I’m sorry for the delay in getting back to you. I think the best way to do this would be using a mix of output variables and run conditions.

You would need to know when the server pending restart generally happens (Which step). You can place a manual intervention step after it which has a variable run condition set to only run if the evaluated variable is true.

The variable can be an output variable from any previous step which is set to true if the server requires a restart.

You are able to write some custom scripting logic in your step to determine if the server is pending a restart. Then set an output variable to True or False like below:

Set-OctopusVariable -name "PendingRestart" -value "True"

In your intervention step you can set the variable run condition to #{Octopus.Action[StepName].Output.PendingRestart}. If Octopus evaluates this to true, the intervention will run and pause the deployment.

Let me know if this helps, or if you have any further questions. :slight_smile:

Best regards,
Daniel

Thanks Daniel,

that does work indeed…

Hi Emil,

Great! I’m glad to hear. :slight_smile:

Please feel free to get in touch at any time.

Best regards,
Daniel