Create-autodeployoverride doesn't work if selected version is in state 'Failed'

I’m using create-autodeployoverride to override the default auto deploy rules and deploy a specific version. This however does not work if the last deployment of this version ended in the state ‘Failed’. Is there a way around this? The docs make it sound like this should work regardless of the state.

I’m thinking I could use the new task state api ($octobase/api/tasks/$taskId/state) to set the state to succesful within the deployment in a step which only runs on failure. What would you recommend?


Thanks for getting in touch.

Currently all auto-deployments (from overrides or project triggers) make their decision on what to deploy based on the latest successful deployment for the given release.

Unfortunately (as you have found) this is a problem when your most recent deployment has failed. We have an existing GitHub issue you can follow that intends to address this problem.

Until this fix is available, yes the new task state API is a great idea. You could have that in a step that only runs on failure as you suggested, or you could consider rolling your own webhook and use subscriptions, subscribe to DeploymentFailed events for your project, then use the REST API to handle the situation in various ways. ie. retry the failed deployment or, again, use the task state API to update the task state to Success, then create another override so it’ll handle the situation correctly when a new machine comes online.