mirror of
https://github.com/andres-montanez/Magallanes
synced 2024-06-28 02:00:05 +02:00
More flexibility on releases path. Addresses Issue #7.
This commit is contained in:
parent
59cdb24087
commit
adb3a67924
|
@ -10,16 +10,20 @@ class Mage_Task_BuiltIn_Deployment_Releases
|
||||||
|
|
||||||
public function run()
|
public function run()
|
||||||
{
|
{
|
||||||
if ($this->_config->release('enabled', false) == true) {
|
if ($this->_config->release('enabled', false) == true) {
|
||||||
$releasesDirectory = $this->_config->release('directory', 'releases');
|
$releasesDirectory = $this->_config->release('directory', 'releases');
|
||||||
$symlink = $this->_config->release('symlink', 'current');
|
$symlink = $this->_config->release('symlink', 'current');
|
||||||
|
|
||||||
|
if (substr($symlink, 0, 1) == '/') {
|
||||||
|
$releasesDirectory = rtrim($this->_config->deployment('to'), '/') . '/' . $releasesDirectory;
|
||||||
|
}
|
||||||
|
|
||||||
$currentCopy = $releasesDirectory . '/' . $this->_config->getReleaseId();
|
$currentCopy = $releasesDirectory . '/' . $this->_config->getReleaseId();
|
||||||
|
|
||||||
// Fetch the user and group from base directory
|
// Fetch the user and group from base directory
|
||||||
$userGroup = '33:33';
|
$userGroup = '33:33';
|
||||||
$resultFetch = $this->_runRemoteCommand('ls -ld . | awk \'{print \$3\":\"\$4}\'', $userGroup);
|
$resultFetch = $this->_runRemoteCommand('ls -ld . | awk \'{print \$3\":\"\$4}\'', $userGroup);
|
||||||
|
|
||||||
// Remove symlink if exists; create new symlink and change owners
|
// Remove symlink if exists; create new symlink and change owners
|
||||||
$command = 'rm -f ' . $symlink
|
$command = 'rm -f ' . $symlink
|
||||||
. ' ; '
|
. ' ; '
|
||||||
|
@ -55,7 +59,7 @@ class Mage_Task_BuiltIn_Deployment_Releases
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return $result;
|
return $result;
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in a new issue