Commit 7a550519 authored by Jon Pugh's avatar Jon Pugh

Merge branch '7.x-3.x' of git.drupal.org:project/provision into 2754069-decouple-install-alternate

parents f7623833 70fb1e13
......@@ -3,6 +3,19 @@
/**
* @file manual site migrate system
*/
/**
* Convert a directory name to a drush aliasname, stripping unwanted chars.
*
* @param string $name The directory name.
*
* @return string
* A drush alias name for the platform.
*/
function _provision_path_to_platform_alias($name) {
return '@platform_' . preg_replace("/[!\W]/", "", basename(rtrim($name, '/')));
}
function drush_provision_hostmaster_migrate_validate($site, $platform) {
// XXX: this doesn't actually document the pre alpha9 upgrade path
drush_print('
......@@ -43,7 +56,7 @@ We are making the following assumptions:
drush_set_option('site_name', '@hostmaster');
drush_set_option('old_platform', d('@hostmaster')->platform->name);
$new_platform = '@platform_' . preg_replace("/[!\W]/", "", basename(rtrim($platform, '/')));
$new_platform = _provision_path_to_platform_alias($platform);
drush_invoke_process('@none', "provision-save", array($new_platform), array(
'context_type' => 'platform',
'server' => '@server_master',
......@@ -95,7 +108,7 @@ We are making the following assumptions:
}
$old_platform = '@platform_' . preg_replace("/[!\W]/", "", basename(rtrim($data['publish_path'], '/')));
$old_platform = _provision_path_to_platform_alias($data['publish_path']);
drush_invoke_process('@none', "provision-save", array($old_platform), array(
'context_type' => 'platform',
'server' => $server,
......@@ -109,7 +122,7 @@ We are making the following assumptions:
return false;
}
$new_platform = '@platform_' . preg_replace("/[!\W]/", "", basename(rtrim($platform, '/')));
$new_platform = _provision_path_to_platform_alias($platform);
drush_invoke_process('@none', "provision-save", array($new_platform), array(
'context_type' => 'platform',
'server' => $server,
......
......@@ -99,6 +99,8 @@ function _provision_system_query($type) {
if ($frags[0] == 'sites' && $frags[1] != 'all') {
$package->platform = -1;
}
// In Drupal 8, system_get_info returns enabled modules/themes.
$package->status = 1;
$package->filename = realpath($package->filename);
......
......@@ -80,7 +80,7 @@ function drush_provision_drupal_provision_migrate($platform, $new_name = NULL) {
// If the site is migrated between platforms and not just renamed,
// we should update the info collected about source and target platform first.
// Note that we have to exclude Hostmaster platform from this extra verify.
if (!provision_is_hostmaster_site()) {
if (!provision_is_hostmaster_site() && drush_get_option('provision_verify_platforms_before_migrate', TRUE)) {
if (!is_null(d($platform)->name) && (d($platform)->name != d()->platform->name)) {
provision_backend_invoke('@hostmaster', 'hosting-task', array(d()->platform->name, 'verify'), array('force' => TRUE));
sleep(5); // A small trick to avoid high load and race conditions.
......
......@@ -7,6 +7,16 @@
* @see drush_command_invoke_all()
*/
/**
* Possible variables to set in local.drushrc.php or another drushrc location Drush supports.
*
* usage:
* $options['provision_backup_suffix'] = '.tar.bz2';
*
* provision_verify_platforms_before_migrate - When migrating many sites turning this off can save time, default TRUE.
* provision_backup_suffix - Method to set the compression used for backups... e.g. '.tar.bz2' or '.tar.', defaults to '.tar.gz'.
*
*/
/**
* Implements hook_drush_load(). Deprecated. Removed in Drush 7.x.
......
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