mirror of
https://github.com/hauke68/Magallanes.git
synced 2025-09-18 06:30:17 +02:00
Merge pull request #195 from spongeben/fix-rsync-deploy
Fix 1st deploy bug
This commit is contained in:
commit
a45802acea
@ -74,12 +74,13 @@ class ReleaseTask extends AbstractTask implements IsReleaseAware, SkipOnOverride
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($resultFetch && $userGroup != '') {
|
if ($resultFetch && $userGroup != '') {
|
||||||
$command = 'chown -h ' . $userGroup . ' ' . $symlink
|
$command = 'chown -R ' . $userGroup . ' ' . $currentCopy
|
||||||
. ' && '
|
|
||||||
. 'chown -R ' . $userGroup . ' ' . $currentCopy
|
|
||||||
. ' && '
|
. ' && '
|
||||||
. 'chown ' . $userGroup . ' ' . $releasesDirectory;
|
. 'chown ' . $userGroup . ' ' . $releasesDirectory;
|
||||||
|
if (file_exists($symlink)) {
|
||||||
|
$command.= ' && ' . 'chown -h ' . $userGroup . ' ' . $symlink;
|
||||||
|
}
|
||||||
$result = $this->runCommandRemote($command);
|
$result = $this->runCommandRemote($command);
|
||||||
if (!$result) {
|
if (!$result) {
|
||||||
return $result;
|
return $result;
|
||||||
|
@ -73,11 +73,13 @@ class RsyncTask extends BaseStrategyTaskAbstract implements IsReleaseAware
|
|||||||
// rsync: { copy: yes }
|
// rsync: { copy: yes }
|
||||||
$rsync_copy = $this->getConfig()->deployment('rsync');
|
$rsync_copy = $this->getConfig()->deployment('rsync');
|
||||||
// If copy_tool_rsync, use rsync rather than cp for finer control of what is copied
|
// 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'])) {
|
if ($rsync_copy && is_array($rsync_copy) && $rsync_copy['copy'] && is_dir("$releasesDirectory/$currentRelease")) {
|
||||||
$this->runCommandRemote("rsync -a {$this->excludes(array_merge($excludes, $rsync_copy['rsync_excludes']))} "
|
if (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()}");
|
. "$releasesDirectory/$currentRelease/ $releasesDirectory/{$this->getConfig()->getReleaseId()}");
|
||||||
} elseif ($rsync_copy && is_array($rsync_copy) && $rsync_copy['copy']) {
|
} else {
|
||||||
$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