Commit 0dc24e83 authored by Jon Pugh's avatar Jon Pugh

Merge branch '2960237-sync-alter' of git.drupal.org:project/provision into 7.x-3.x

parents fb0e45c2 8e8a80dc
......@@ -108,7 +108,9 @@ function provision_drupal_push_site($override_slave_authority = FALSE) {
));
// Sync the platform
d()->service('http')->sync(d()->root, array('exclude-sites' => TRUE));
$sync_path = d()->root;
drush_command_invoke_all_ref('provision_platform_sync_path_alter', $sync_path, d());
d()->service('http')->sync($sync_path, array('exclude-sites' => TRUE));
if (d()->type === 'site') {
// Check whether we're hosted on a cluster, in which case, the master is
......
......@@ -317,6 +317,31 @@ function hook_provision_config_variables_alter(&$variables, $template, $config)
}
}
/**
* Implements hook_provision_platform_sync_path_alter().
*
* Changes the sync_path to ensure that composer-built platforms get all of the
* code moved to remote servers.
*
* @see provision_git_provision_platform_sync_path_alter()
*`
* @param $sync_path
* If the site is hosted on a remote server, this is the path that will be
* rsync'd over.
*/
function hook_provision_platform_sync_path_alter(&$sync_path) {
$repo_path = d()->platform->repo_path;
if ($repo_path != d()->root) {
$sync_path = $repo_path;
if (!file_exists($repo_path)) {
return drush_set_error('PROVISION_ERROR', dt("Platform !path does not exist.", array(
'!path' => $repo_path,
)));
}
}
}
/**
* Alter the array of directories to create.
*
......
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