mirror of
https://github.com/hauke68/Magallanes.git
synced 2026-09-05 00:48:57 +02:00
when releasing or rolling back, don’t chown the »current« symlink before we changed / created it. also don’t screw up the ssh cmdline if no username was given.
This commit is contained in:
@@ -78,18 +78,19 @@ class ReleaseTask extends AbstractTask implements IsReleaseAware, SkipOnOverride
|
||||
$command = 'chown -R ' . $userGroup . ' ' . $currentCopy
|
||||
. ' && '
|
||||
. 'chown ' . $userGroup . ' ' . $releasesDirectory;
|
||||
if (file_exists($symlink)) {
|
||||
$command.= ' && ' . 'chown -h ' . $userGroup . ' ' . $symlink;
|
||||
}
|
||||
$result = $this->runCommandRemote($command);
|
||||
if (!$result) {
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
|
||||
// Remove symlink if exists; create new symlink and change owner
|
||||
$tmplink = $currentCopy . '.tmp';
|
||||
$command = "ln -sfn {$currentCopy} {$tmplink} && mv -fT {$tmplink} {$symlink}";
|
||||
// Switch symlink and change owner
|
||||
$tmplink = $symlink . '.tmp';
|
||||
$command = "ln -sfn {$currentCopy} {$tmplink}";
|
||||
if ($resultFetch && $userGroup != '') {
|
||||
$command.= " && chown -h {$userGroup} {$tmplink}";
|
||||
}
|
||||
$command.= " && mv -fT {$tmplink} {$symlink}";
|
||||
$result = $this->runCommandRemote($command);
|
||||
|
||||
if ($result) {
|
||||
|
||||
@@ -100,7 +100,9 @@ class RsyncTask extends BaseStrategyTaskAbstract implements IsReleaseAware
|
||||
. $this->excludes($excludes) . ' '
|
||||
. $this->excludesListFile($excludesListFilePath) . ' '
|
||||
. $this->getConfig()->deployment('from') . ' '
|
||||
. $this->getConfig()->deployment('user') . '@' . $this->getConfig()->getHostName() . ':' . $deployToDirectory;
|
||||
. ( $this->getConfig()->deployment('user') ? $this->getConfig()->deployment('user') . '@' : '' )
|
||||
. $this->getConfig()->getHostName() . ':' . $deployToDirectory;
|
||||
|
||||
$result = $this->runCommandLocal($command);
|
||||
|
||||
return $result;
|
||||
|
||||
Reference in New Issue
Block a user