mirror of
https://github.com/andres-montanez/Magallanes
synced 2024-05-18 13:46:40 +02:00
Merge 612e71e451
into 5fa99c68f5
This commit is contained in:
commit
9321d7ea3c
|
@ -45,6 +45,7 @@ class CopyTask extends AbstractTask
|
||||||
|
|
||||||
$tarPath = $this->runtime->getEnvOption('tar_extract_path', 'tar');
|
$tarPath = $this->runtime->getEnvOption('tar_extract_path', 'tar');
|
||||||
$flags = $this->runtime->getEnvOption('tar_extract', 'xfzop');
|
$flags = $this->runtime->getEnvOption('tar_extract', 'xfzop');
|
||||||
|
$timeout = $this->runtime->getEnvOption('tar_timeout', 300);
|
||||||
$targetDir = sprintf('%s/releases/%s', $hostPath, $currentReleaseId);
|
$targetDir = sprintf('%s/releases/%s', $hostPath, $currentReleaseId);
|
||||||
|
|
||||||
$tarLocal = $this->runtime->getVar('tar_local');
|
$tarLocal = $this->runtime->getVar('tar_local');
|
||||||
|
@ -53,10 +54,10 @@ class CopyTask extends AbstractTask
|
||||||
$cmdCopy = sprintf('scp -P %d %s %s %s@%s:%s/%s', $sshConfig['port'], $sshConfig['flags'], $tarLocal, $user, $host, $targetDir, $tarRemote);
|
$cmdCopy = sprintf('scp -P %d %s %s %s@%s:%s/%s', $sshConfig['port'], $sshConfig['flags'], $tarLocal, $user, $host, $targetDir, $tarRemote);
|
||||||
|
|
||||||
/** @var Process $process */
|
/** @var Process $process */
|
||||||
$process = $this->runtime->runLocalCommand($cmdCopy, 300);
|
$process = $this->runtime->runLocalCommand($cmdCopy, $timeout);
|
||||||
if ($process->isSuccessful()) {
|
if ($process->isSuccessful()) {
|
||||||
$cmdUnTar = sprintf('cd %s && %s %s %s', $targetDir, $tarPath, $flags, $tarRemote);
|
$cmdUnTar = sprintf('cd %s && %s %s %s', $targetDir, $tarPath, $flags, $tarRemote);
|
||||||
$process = $this->runtime->runRemoteCommand($cmdUnTar, false, 600);
|
$process = $this->runtime->runRemoteCommand($cmdUnTar, false, $timeout * 2);
|
||||||
if ($process->isSuccessful()) {
|
if ($process->isSuccessful()) {
|
||||||
$cmdDelete = sprintf('rm %s/%s', $targetDir, $tarRemote);
|
$cmdDelete = sprintf('rm %s/%s', $targetDir, $tarRemote);
|
||||||
$process = $this->runtime->runRemoteCommand($cmdDelete, false);
|
$process = $this->runtime->runRemoteCommand($cmdDelete, false);
|
||||||
|
|
|
@ -43,11 +43,12 @@ class PrepareTask extends AbstractTask
|
||||||
$excludes = $this->getExcludes();
|
$excludes = $this->getExcludes();
|
||||||
$tarPath = $this->runtime->getEnvOption('tar_create_path', 'tar');
|
$tarPath = $this->runtime->getEnvOption('tar_create_path', 'tar');
|
||||||
$flags = $this->runtime->getEnvOption('tar_create', 'cfzp');
|
$flags = $this->runtime->getEnvOption('tar_create', 'cfzp');
|
||||||
|
$timeout = $this->runtime->getEnvOption('tar_timeout', 300);
|
||||||
$from = $this->runtime->getEnvOption('from', './');
|
$from = $this->runtime->getEnvOption('from', './');
|
||||||
$cmdTar = sprintf('%s %s %s %s %s', $tarPath, $flags, $tarLocal, $excludes, $from);
|
$cmdTar = sprintf('%s %s %s %s %s', $tarPath, $flags, $tarLocal, $excludes, $from);
|
||||||
|
|
||||||
/** @var Process $process */
|
/** @var Process $process */
|
||||||
$process = $this->runtime->runLocalCommand($cmdTar, 300);
|
$process = $this->runtime->runLocalCommand($cmdTar, $timeout);
|
||||||
return $process->isSuccessful();
|
return $process->isSuccessful();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue