This commit is contained in:
humbkr 2018-03-29 22:09:13 +00:00 committed by GitHub
commit 9321d7ea3c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 3 deletions

View file

@ -45,6 +45,7 @@ class CopyTask extends AbstractTask
$tarPath = $this->runtime->getEnvOption('tar_extract_path', 'tar');
$flags = $this->runtime->getEnvOption('tar_extract', 'xfzop');
$timeout = $this->runtime->getEnvOption('tar_timeout', 300);
$targetDir = sprintf('%s/releases/%s', $hostPath, $currentReleaseId);
$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);
/** @var Process $process */
$process = $this->runtime->runLocalCommand($cmdCopy, 300);
$process = $this->runtime->runLocalCommand($cmdCopy, $timeout);
if ($process->isSuccessful()) {
$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()) {
$cmdDelete = sprintf('rm %s/%s', $targetDir, $tarRemote);
$process = $this->runtime->runRemoteCommand($cmdDelete, false);

View file

@ -43,11 +43,12 @@ class PrepareTask extends AbstractTask
$excludes = $this->getExcludes();
$tarPath = $this->runtime->getEnvOption('tar_create_path', 'tar');
$flags = $this->runtime->getEnvOption('tar_create', 'cfzp');
$timeout = $this->runtime->getEnvOption('tar_timeout', 300);
$from = $this->runtime->getEnvOption('from', './');
$cmdTar = sprintf('%s %s %s %s %s', $tarPath, $flags, $tarLocal, $excludes, $from);
/** @var Process $process */
$process = $this->runtime->runLocalCommand($cmdTar, 300);
$process = $this->runtime->runLocalCommand($cmdTar, $timeout);
return $process->isSuccessful();
}