Commit 2a884bd3 authored by Adrian Rossouw's avatar Adrian Rossouw Committed by adrian

Add a hostmaster migrate command

parent c9679850
<?php
/**
* @file manual site migrate system
*/
function drush_provision_hostmaster_migrate_validate($site, $platform) {
// verify the target platform:
$data = drush_get_merged_options(); // XXX: necessary because the remote
// platform may not have been
// initialised by the frontend (this
// should be checked instead)
$data['root'] = $platform;
$data['r'] = $platform;
drush_backend_invoke('provision verify', $data);
// verify the current platform
drush_backend_invoke('provision verify', array('root' => drush_get_option(array('r', 'root'), drush_locate_root())));
// verify the site prior to migration
drush_backend_invoke('provision verify', array($site));
}
function drush_provision_pre_hostmaster_migrate($site, $platform) {
drush_backend_invoke('hostmaster park', array($site, 'uri' => $site));
}
function drush_provision_hostmaster_migrate($site, $platform) {
drush_backend_invoke('provision clone', array($site, $site, $platform));
}
function drush_provision_hostmaster_migrate_rollback($site, $platform) {
drush_backend_invoke('provision delete ', array($site, 'root' => $platform));
}
function drush_provision_post_hostmaster_migrate($site, $platform) {
drush_backend_invoke('hostmaster unpark', array($site, 'uri' => $site, 'root' => $platform));
if (!drush_get_error()) {
drush_backend_invoke('provision delete', array($site));
drush_backend_invoke('provision verify', array($site, 'root' => $platform, 'publish_path' => $platform));
}
}
......@@ -121,6 +121,15 @@ function provision_drush_command() {
'bootstrap' => DRUSH_BOOTSTRAP_DRUPAL_ROOT
);
$items['hostmaster migrate'] = array(
'description' => dt('Migrate an instance of the Hostmaster front end to a new platform'),
'bootstrap' => DRUSH_BOOTSTRAP_DRUPAL_ROOT,
'arguments' => array(
'example.com' => dt('The name of the site to migrate'),
'/path/to/platform' => dt('The platform to migrate the site to.')
),
);
return $items;
}
......
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