mirror of
https://github.com/hauke68/Magallanes.git
synced 2025-09-12 20:20:18 +02:00
Merge pull request #63 from oddnoc/remote-rsync
Add ability to use rsync rather than cp on remote
This commit is contained in:
commit
a51056b9c1
@ -67,7 +67,11 @@ class RsyncTask extends BaseStrategyTaskAbstract implements IsReleaseAware
|
|||||||
// If deployment configuration is rsync, include a flag to simply sync the deltas between the prior release
|
// If deployment configuration is rsync, include a flag to simply sync the deltas between the prior release
|
||||||
// rsync: { copy: yes }
|
// rsync: { copy: yes }
|
||||||
$rsync_copy = $this->getConfig()->deployment('rsync');
|
$rsync_copy = $this->getConfig()->deployment('rsync');
|
||||||
if ( $rsync_copy && is_array($rsync_copy) && $rsync_copy['copy'] ) {
|
// If copy_tool_rsync, use rsync rather than cp for finer control of what is copied
|
||||||
|
if ( $rsync_copy && is_array($rsync_copy) && $rsync_copy['copy'] && isset($rsync_copy['copy_tool_rsync']) ) {
|
||||||
|
$this->runCommandRemote("rsync -a {$this->excludes(array_merge($excludes, $rsync_copy['rsync_excludes']))} "
|
||||||
|
. "$releasesDirectory/$currentRelease/ $releasesDirectory/{$this->getConfig()->getReleaseId()}");
|
||||||
|
} elseif ( $rsync_copy && is_array($rsync_copy) && $rsync_copy['copy'] ) {
|
||||||
$this->runCommandRemote('cp -R ' . $releasesDirectory . '/' . $currentRelease . ' ' . $releasesDirectory . '/' . $this->getConfig()->getReleaseId());
|
$this->runCommandRemote('cp -R ' . $releasesDirectory . '/' . $currentRelease . ' ' . $releasesDirectory . '/' . $this->getConfig()->getReleaseId());
|
||||||
} else {
|
} else {
|
||||||
$this->runCommandRemote('mkdir -p ' . $releasesDirectory . '/' . $this->getConfig()->getReleaseId());
|
$this->runCommandRemote('mkdir -p ' . $releasesDirectory . '/' . $this->getConfig()->getReleaseId());
|
||||||
|
Loading…
Reference in New Issue
Block a user