Hey,

Carlo Zancanaro <[email protected]> skribis:

> (define (deployment-okay? machine)
>   ;; Your logic here.  This runs on the local machine, so you can try to make
>   ;; an SSH connection or something like that.
>   )
>
> (define (deploy-auto-roll-back-managed-host machine)
>   (mbegin %store-monad
>     (deploy-managed-host machine)
>     (unless (deployment-okay? machine)
>       (raise (condition (&deploy-error
>                          (should-roll-back #t)
>                          (captured-args
>                           (raise "Deployment not okay - triggered 
> roll-back"))))))))
>
> (define auto-roll-back-managed-host-environment-type
>   (environment-type
>     (inherit managed-host-environment-type)
>     (deploy-machine deploy-auto-roll-back-managed-host)))

That’s a very smart hack, we should consider doing that by default!
(Like the ‘machine-ssh-configuration’ would provide an SSH check.)

Ludo’.

Reply via email to