mirror of
https://github.com/hauke68/Magallanes.git
synced 2026-09-05 00:48:57 +02:00
Resolve conflict for PR #61
This commit is contained in:
@@ -46,9 +46,30 @@ class ReleaseTask extends AbstractTask implements IsReleaseAware, SkipOnOverride
|
||||
|
||||
$currentCopy = $releasesDirectory . '/' . $this->getConfig()->getReleaseId();
|
||||
|
||||
//Check if target user:group is specified
|
||||
$userGroup = $this->getConfig()->deployment('owner');
|
||||
// Fetch the user and group from base directory; defaults usergroup to 33:33
|
||||
$userGroup = '';
|
||||
$resultFetch = $this->runCommandRemote('ls -ld . | awk \'{print \$3":"\$4}\'', $userGroup);
|
||||
if(empty($userGroup)){
|
||||
$user = '33';
|
||||
$group = '33';
|
||||
$directoryInfos = '';
|
||||
// Get raw directory info and parse it in php.
|
||||
// "stat" command don't behave the same on different systems, ls output format also varies
|
||||
// and awk parameters need special care depending on the executing shell
|
||||
$resultFetch = $this->runCommandRemote("ls -ld .", $directoryInfos);
|
||||
if(!empty($directoryInfos)){
|
||||
//uniformize format as it depends on the system deployed on
|
||||
$directoryInfos = trim(str_replace(array(" ", "\t"), ' ', $directoryInfos));
|
||||
$infoArray = explode(' ', $directoryInfos);
|
||||
if(!empty($infoArray[2])) {
|
||||
$user = $infoArray[2];
|
||||
}
|
||||
if(!empty($infoArray[3])) {
|
||||
$group = $infoArray[3];
|
||||
}
|
||||
$userGroup = $user . ':' . $group;
|
||||
}
|
||||
}
|
||||
|
||||
// Remove symlink if exists; create new symlink and change owners
|
||||
$command = 'rm -f ' . $symlink
|
||||
|
||||
@@ -62,6 +62,8 @@ class RsyncTask extends BaseStrategyTaskAbstract implements IsReleaseAware
|
||||
$deployToDirectory = rtrim($this->getConfig()->deployment('to'), '/')
|
||||
. '/' . $releasesDirectory
|
||||
. '/' . $this->getConfig()->getReleaseId();
|
||||
|
||||
Console::log('Deploy to ' . $deployToDirectory);
|
||||
$resultFetch = $this->runCommandRemote('ls -ld ' . $symlink . ' | cut -d"/" -f2', $currentRelease);
|
||||
|
||||
if ($resultFetch && $currentRelease) {
|
||||
|
||||
@@ -51,11 +51,11 @@ class TarGzTask extends BaseStrategyTaskAbstract implements IsReleaseAware
|
||||
$deployToDirectory = $this->getConfig()->deployment('to');
|
||||
if ($this->getConfig()->release('enabled', false) == true) {
|
||||
$releasesDirectory = $this->getConfig()->release('directory', 'releases');
|
||||
|
||||
$deployToDirectory = rtrim($this->getConfig()->deployment('to'), '/')
|
||||
. '/' . $releasesDirectory
|
||||
. '/' . $this->getConfig()->getReleaseId();
|
||||
$this->runCommandRemote('mkdir -p ' . $releasesDirectory . '/' . $this->getConfig()->getReleaseId());
|
||||
$output = null;
|
||||
$this->runCommandRemote('mkdir -p ' . $deployToDirectory, $output , false);
|
||||
}
|
||||
|
||||
// Create Tar Gz
|
||||
|
||||
Reference in New Issue
Block a user