Commit 6bb20f91 authored by drumm's avatar drumm Committed by Neil Drumm

Platform root syncing.

parent 03be5425
......@@ -459,6 +459,9 @@ class provisionService_file extends provisionService {
/**
* If necessary, sync files out to a remote server.
*/
function sync() {
function sync($path = NULL) {
if (is_null($path)) {
$path = $this->config_path;
}
}
}
......@@ -2,17 +2,19 @@
class provisionService_file_remote extends provisionService_file {
function init() {
$this->remote_config_path = $this->config_path;
$this->config_path = $this->config_path . '--' . $this->remote_host;
parent::init();
}
function sync() {
if (!drush_shell_exec('rsync -azC --delete %s/ %s@%s:%s', $this->config_path, $this->script_user, $this->remote_host, $this->remote_config_path)) {
return drush_set_error('PROVISION_FILE_SYNC_FAILED', dt("Files could not be synced to remote server. Changes might not be available until this has been done. (error: %msg)", array("%msg" => join("\n", drush_shell_exec_output()))));
function sync($path = NULL) {
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)) {
drush_log(dt('@path has been synced to remote server.', array('@path' => $path)));
}
else {
drush_log(dt('Files have been synced to remote server.'));
drush_set_error('PROVISION_FILE_SYNC_FAILED', dt('Files could not be synced to remote server. Changes might not be available until this has been done. (error: %msg)', array('@path' => $path, '%msg' => join("\n", drush_shell_exec_output()))));
}
}
}
......@@ -74,6 +74,9 @@ class provisionService_http_apache extends provisionService_http {
function parse_configs($cause_error = FALSE) {
d()->service('file')->sync();
if (d()->type === 'platform' || d()->type === 'site') {
d()->service('file')->sync(d()->root);
}
// This is required to be configurable, due to the fact that different
// hosts might need to do this differently.
if (drush_is_local_host($this->remote_host)) {
......
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