Automated Rollback

So I’ve already read this.

As well as a few threads on the forum. I still feel like I lack an actual answer to the basic question of how do I rollback to a previous version. The general reply seems to be be “just write a script” is there no deployment step that I can put in that is just as simple as if previous step failed, deploy last successfully deployed version? Assume that this is a windows service that is idempotent and can support rolling back to the previous version on failure to start.

Thank you for the help!!

Let me know what I need to do in order to get that functionality.

Hi Caucoin,

Thanks for reaching out!

At this point, there is no deployment step or library template available to automatically re-deploy the last successful version. However, there is a template available - https://library.octopusdeploy.com/step-template/actiontemplate-chain-deployment - that can deploy a known version. You could modify this to find the last successful release via the REST API and deploy that. Combine this with a step that has a ‘Run condition’ of ‘Failure: only run when a previous step failed’ and you will get your desired behaviour.

However, I would recommend being careful as you could run into issues if there are environmental issues - say for example an out of disk space error. You could easily end up in a run away deployment cycle.

Hope this helps!

Cheers,
Matt

Caucion,

i wrote a script to do this that I was working on trying to upload as a step template to the library. It’s something that we have needed in our environment. I’ve uploaded a copy of the script in case you wanted to write your own or wanted to see what you can do with it.

Deploy_Last_successful_release_-_Copy.txt (1018 Bytes)