Stopping Deployment via Script Module

Is there a way to halt a deployment using a command in a script module? I’m looking to implement something where if certain deployment conditions aren’t met (i.e. runtime variables), the deployment halts. Thanks.

Hi Shannon,

Thanks for getting in touch, and great question! A couple options come to mind as to how to approach this. You could set an if statement to check for the variable, around a Fail-Step message (link to our error handling doc page) to only run if the conditions in the if statement are not satisfied. Something like the following:

#{unless variable=="GoodToRun"}
    Fail-Step "Halting Deployment"
#{/unless}

This will only run the enclosed Fail-Step when the variable’s value does not equal “GoodToRun”.

You could also enable guided failure mode on this project, where, in the case of a failure, it will put the deployment task in an intervention state requiring input on whether to fail/retry/ignore the task.

Another potentially useful feature is run conditions to define which conditions must be met for the step itself to run.

I hope that helps answer your question. Please let me know what you think, or if you have any further questions or concerns going forward!

Best regards,

Kenny

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