diff --git a/src/Task/BuiltIn/Deploy/Tar/CopyTask.php b/src/Task/BuiltIn/Deploy/Tar/CopyTask.php index 997023d..5150a2e 100644 --- a/src/Task/BuiltIn/Deploy/Tar/CopyTask.php +++ b/src/Task/BuiltIn/Deploy/Tar/CopyTask.php @@ -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); diff --git a/src/Task/BuiltIn/Deploy/Tar/PrepareTask.php b/src/Task/BuiltIn/Deploy/Tar/PrepareTask.php index 9db8486..d872591 100644 --- a/src/Task/BuiltIn/Deploy/Tar/PrepareTask.php +++ b/src/Task/BuiltIn/Deploy/Tar/PrepareTask.php @@ -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(); }