Browse Source

Refactor tar gz to reuse function.

1.0
woutersioen 10 years ago
parent
commit
b869876c26
  1. 20
      Mage/Task/BuiltIn/Deployment/Strategy/TarGzTask.php

20
Mage/Task/BuiltIn/Deployment/Strategy/TarGzTask.php

@ -75,25 +75,11 @@ class TarGzTask extends BaseStrategyTaskAbstract implements IsReleaseAware
$result = $this->runCommandLocal($command) && $result; $result = $this->runCommandLocal($command) && $result;
// Extract Tar Gz // Extract Tar Gz
if ($this->getConfig()->release('enabled', false) == true) { $this->getReleasesAwareCommand('tar xfz ' . $remoteTarGz . '.tar.gz');
$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';
}
$result = $this->runCommandRemote($command) && $result; $result = $this->runCommandRemote($command) && $result;
// Delete Tar Gz from Remote Host // Delete Tar Gz from Remote Host
if ($this->getConfig()->release('enabled', false) == true) { $this->getReleasesAwareCommand('rm ' . $remoteTarGz . '.tar.gz');
$releasesDirectory = $this->getConfig()->release('directory', 'releases');
$deployToDirectory = $releasesDirectory . '/' . $this->getConfig()->getReleaseId();
$command = 'rm ' . $deployToDirectory . '/' . $remoteTarGz . '.tar.gz';
} else {
$command = 'rm ' . $remoteTarGz . '.tar.gz';
}
$result = $this->runCommandRemote($command) && $result; $result = $this->runCommandRemote($command) && $result;
// Delete Tar Gz from Local // Delete Tar Gz from Local
@ -137,4 +123,4 @@ class TarGzTask extends BaseStrategyTaskAbstract implements IsReleaseAware
return $result; return $result;
} }
} }

Loading…
Cancel
Save