Commit f7a07113 authored by anarcat's avatar anarcat

1081536 rollback platform apache configs

when drush make fails, the apache config is already created and wasn't
cleaned up

we hook into the rollback by adding a new magic hook through
command_invoke() that will cascade through the current context and call
the right rollback hook.

we implement one for the platform, but we probably need to implement one
for servers and sites too.
parent 314f01ce
......@@ -36,6 +36,16 @@ class provisionService_http extends provisionService {
$this->parse_configs();
}
/**
* Hook into command_invoke for provision-verify
*
* This deletes the http configuration for platforms
*
* @see ::verify_platform_cmd()
*/
function verify_rollback_platform_cmd() {
$this->delete_config($this->context->type);
}
/**
* Register the http handler for platforms, based on the web_server option.
......
......@@ -218,10 +218,33 @@ function drush_provision_save($alias = null) {
}
}
/**
* Implementation of drush_hook_verify()
*
* This is a shortcut to avoid declaring that hook for all object
* combinations.
*
* @see provisionContext::command_invoke()
*/
function drush_provision_verify() {
d()->command_invoke('verify');
}
/**
* Implementation of drush_hook_verify_rollback()
*
* This is to make sure that the command_invoke() magic is also
* invoked on rollbacks for the contexts.
*
* We abuse a bit the semantics here by appending _rollback, but it's
* better than nothing.
*
* @see provisionContext::command_invoke()
*/
function drush_provision_verify_rollback() {
d()->command_invoke('verify_rollback');
}
function _provision_default_web_group() {
$info = posix_getgrgid(posix_getgid());
$common_groups = array(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment