mirror of
https://github.com/andres-montanez/Magallanes
synced 2024-06-16 04:25:06 +02:00
Refactor tar gz to reuse function.
This commit is contained in:
parent
f7e2163fed
commit
b869876c26
|
@ -75,25 +75,11 @@ class TarGzTask extends BaseStrategyTaskAbstract implements IsReleaseAware
|
|||
$result = $this->runCommandLocal($command) && $result;
|
||||
|
||||
// Extract Tar Gz
|
||||
if ($this->getConfig()->release('enabled', false) == true) {
|
||||
$releasesDirectory = $this->getConfig()->release('directory', 'releases');
|
||||
|
||||
$deployToDirectory = $releasesDirectory . '/' . $this->getConfig()->getReleaseId();
|
||||
$command = 'cd ' . $deployToDirectory . ' && tar xfz ' . $remoteTarGz . '.tar.gz';
|
||||
} else {
|
||||
$command = 'tar xfz ' . $remoteTarGz . '.tar.gz';
|
||||
}
|
||||
$this->getReleasesAwareCommand('tar xfz ' . $remoteTarGz . '.tar.gz');
|
||||
$result = $this->runCommandRemote($command) && $result;
|
||||
|
||||
// Delete Tar Gz from Remote Host
|
||||
if ($this->getConfig()->release('enabled', false) == true) {
|
||||
$releasesDirectory = $this->getConfig()->release('directory', 'releases');
|
||||
|
||||
$deployToDirectory = $releasesDirectory . '/' . $this->getConfig()->getReleaseId();
|
||||
$command = 'rm ' . $deployToDirectory . '/' . $remoteTarGz . '.tar.gz';
|
||||
} else {
|
||||
$command = 'rm ' . $remoteTarGz . '.tar.gz';
|
||||
}
|
||||
$this->getReleasesAwareCommand('rm ' . $remoteTarGz . '.tar.gz');
|
||||
$result = $this->runCommandRemote($command) && $result;
|
||||
|
||||
// Delete Tar Gz from Local
|
||||
|
@ -137,4 +123,4 @@ class TarGzTask extends BaseStrategyTaskAbstract implements IsReleaseAware
|
|||
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue