docs/contrib/rsync.md
require 'contrib/rsync.php';
:::warning
This must not be confused with /src/Utility/Rsync.php, deployer's built-in rsync. Their configuration options are also very different, read carefully below.
:::
-- as it's automatically added.Following is default configuration. By default rsync ignores only git dir and deploy.php file.
deploy.php
set('rsync',[
'exclude' => [
'.git',
'deploy.php',
],
'exclude-file' => false,
'include' => [],
'include-file' => false,
'filter' => [],
'filter-file' => false,
'filter-perdir'=> false,
'flags' => 'rz', // Recursive, with compress
'options' => ['delete'],
'timeout' => 60,
]);
If You have multiple excludes, You can put them in file and reference that instead. If You use deploy:rsync_warmup You could set additional options that could speed-up and/or affect way things are working. For example:
deploy.php
set('rsync',[
'exclude' => ['excludes_file'],
'exclude-file' => '/tmp/localdeploys/excludes_file', //Use absolute path to avoid possible rsync problems
'include' => [],
'include-file' => false,
'filter' => [],
'filter-file' => false,
'filter-perdir' => false,
'flags' => 'rzcE', // Recursive, with compress, check based on checksum rather than time/size, preserve Executable flag
'options' => ['delete', 'delete-after', 'force'], //Delete after successful transfer, delete even if deleted dir is not empty
'timeout' => 3600, //for those huge repos or crappy connection
]);
This is default configuration:
set('rsync_src', __DIR__);
set('rsync_dest','{{release_path}}');
If You use local deploy recipe You can set src to local release:
host('hostname')
->hostname('10.10.10.10')
->port(22)
->set('deploy_path','/your/remote/path/app')
->set('rsync_src', '/your/local/path/app')
->set('rsync_dest','{{release_path}}');
rsync task
Set rsync_src to locally cloned repository and rsync to rsync_dest. Then set this task instead of deploy:update_code in Your deploy task if Your hosting provider does not allow git.rsync:warmup task
If Your deploy task looks like:
task('deploy', [
'deploy:prepare',
'deploy:release',
'rsync',
'deploy:vendors',
'deploy:symlink',
])->desc('Deploy your project');
rsync_dest is set to {{release_path}} then You could add this task to run before rsync task or after deploy:release, whatever is more convenient.[
'exclude' => [
'.git',
'deploy.php',
],
'exclude-file' => false,
'include' => [],
'include-file' => false,
'filter' => [],
'filter-file' => false,
'filter-perdir' => false,
'flags' => 'rz',
'options' => ['delete'],
'timeout' => 300,
]
__DIR__
'{{release_path}}'
:::info Autogenerated The value of this configuration is autogenerated on access. :::
:::info Autogenerated The value of this configuration is autogenerated on access. :::
:::info Autogenerated The value of this configuration is autogenerated on access. :::
:::info Autogenerated The value of this configuration is autogenerated on access. :::
Warmups remote Rsync target.
Rsync local->remote.