diff --git a/file/file.drush.inc b/file/file.drush.inc index 817533476d2743246b36e5bed795c08aad0d9790..545eca0ac0b560849f37e47a1989cbe08146f07b 100644 --- a/file/file.drush.inc +++ b/file/file.drush.inc @@ -454,8 +454,13 @@ class provisionService_file extends provisionService { /** * If necessary, sync files out to a remote server. + * + * @param $path + * Full path to sync. + * @param $exclude_sites + * Exclude sites/*, except sites/*. */ - function sync($path = NULL) { + function sync($path = NULL, $exclude_sites = FALSE) { if (is_null($path)) { $path = $this->config_path; } diff --git a/file/remote/remote_service.inc b/file/remote/remote_service.inc index 886e011520cd80f0755324a7dbb870b3f6ac71fe..3438d5d5e9a5e2953f82e361b41bcb7b2c0f1b8f 100644 --- a/file/remote/remote_service.inc +++ b/file/remote/remote_service.inc @@ -1,16 +1,23 @@ config_path = $this->config_path . '--' . $this->remote_host; parent::init(); } - function sync($path = NULL) { + function sync($path = NULL, $exclude_sites = FALSE) { if (is_null($path)) { $path = $this->config_path; } - if (drush_shell_exec('rsync -azC --delete %s/ %s@%s:%s', $path, $this->script_user, $this->remote_host, $path)) { + + $options = array( + 'delete' => TRUE, + 'exclude-sites' => $exclude_sites, + ); + if (drush_core_call_rsync(escapeshellarg($path . '/'), escapeshellarg($this->script_user . '@' . $this->remote_host . ':' . $path), $options)) { drush_log(dt('@path has been synced to remote server.', array('@path' => $path))); } else { diff --git a/platform/provision_drupal.drush.inc b/platform/provision_drupal.drush.inc index 02c47b5845f0918078afc9462deb7b569bc182d4..24bf18f9429c4eb8a80dd62f765fbeaa8b1cd427 100644 --- a/platform/provision_drupal.drush.inc +++ b/platform/provision_drupal.drush.inc @@ -171,6 +171,13 @@ function _provision_drupal_site_installed() { return FALSE; } +function provision_drupal_sync_site() { + d()->service('file')->sync(d()->root, TRUE); + if (d()->type === 'site') { + d()->service('file')->sync(d()->root . '/sites/' . d()->uri); + } +} + /** * Generate a settings file for the site. * @@ -183,7 +190,7 @@ function _provision_drupal_site_installed() { function _provision_drupal_create_settings_file() { $config = new provisionConfig_drupal_settings(d()->name); $config->write(); - d()->service('file')->sync(d()->root); + provision_drupal_sync_site(); } class provisionConfig_drupal_settings extends provisionConfig { diff --git a/provision.inc b/provision.inc index abb0cd72aa2d1ee5cd16a02f1259b87c7bf2a23d..b0ecae06ed9a96b301b18089939da8db1d777817 100644 --- a/provision.inc +++ b/provision.inc @@ -43,7 +43,7 @@ function provision_save_site_data() { if (!drush_get_error()) { $config = new provisionConfig_drushrc_site(d()->name); $config->write(); - d()->service('file')->sync(d()->root); + provision_drupal_sync_site(); } } @@ -55,7 +55,7 @@ function provision_save_platform_data() { if (!drush_get_error()) { $config = new provisionConfig_drushrc_platform(d()->name); $config->write(); - d()->service('file')->sync(d()->root); + provision_drupal_sync_site(); } }