From c8d868962232b35226a3a11f29ffe1aff09beea2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9s=20Monta=C3=B1ez?= Date: Sat, 22 Jul 2017 17:14:36 -0300 Subject: [PATCH] Allow to define the tar binary path. --- src/Task/BuiltIn/Deploy/Tar/CopyTask.php | 3 ++- src/Task/BuiltIn/Deploy/Tar/PrepareTask.php | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Task/BuiltIn/Deploy/Tar/CopyTask.php b/src/Task/BuiltIn/Deploy/Tar/CopyTask.php index 0609452..294d2bc 100644 --- a/src/Task/BuiltIn/Deploy/Tar/CopyTask.php +++ b/src/Task/BuiltIn/Deploy/Tar/CopyTask.php @@ -43,6 +43,7 @@ class CopyTask extends AbstractTask $hostPath = rtrim($this->runtime->getEnvOption('host_path'), '/'); $currentReleaseId = $this->runtime->getReleaseId(); + $tarPath = $this->runtime->getEnvOption('tar_extract_path', 'tar'); $flags = $this->runtime->getEnvOption('tar_extract', 'xfzop'); $targetDir = sprintf('%s/releases/%s', $hostPath, $currentReleaseId); @@ -54,7 +55,7 @@ class CopyTask extends AbstractTask /** @var Process $process */ $process = $this->runtime->runLocalCommand($cmdCopy, 300); if ($process->isSuccessful()) { - $cmdUnTar = sprintf('cd %s && tar %s %s', $targetDir, $flags, $tarRemote); + $cmdUnTar = sprintf('cd %s && %s %s %s', $targetDir, $tarPath, $flags, $tarRemote); $process = $this->runtime->runRemoteCommand($cmdUnTar, false, 600); if ($process->isSuccessful()) { $cmdDelete = sprintf('rm %s/%s', $targetDir, $tarRemote); diff --git a/src/Task/BuiltIn/Deploy/Tar/PrepareTask.php b/src/Task/BuiltIn/Deploy/Tar/PrepareTask.php index fb0c5fe..9db8486 100644 --- a/src/Task/BuiltIn/Deploy/Tar/PrepareTask.php +++ b/src/Task/BuiltIn/Deploy/Tar/PrepareTask.php @@ -41,9 +41,10 @@ class PrepareTask extends AbstractTask $this->runtime->setVar('tar_local', $tarLocal); $excludes = $this->getExcludes(); + $tarPath = $this->runtime->getEnvOption('tar_create_path', 'tar'); $flags = $this->runtime->getEnvOption('tar_create', 'cfzp'); $from = $this->runtime->getEnvOption('from', './'); - $cmdTar = sprintf('tar %s %s %s %s', $flags, $tarLocal, $excludes, $from); + $cmdTar = sprintf('%s %s %s %s %s', $tarPath, $flags, $tarLocal, $excludes, $from); /** @var Process $process */ $process = $this->runtime->runLocalCommand($cmdTar, 300);