Skip to content

Commit

Permalink
Merge pull request #12 from ResuBaka/add-support-for-zstd
Browse files Browse the repository at this point in the history
feat: add support for zstd compression
  • Loading branch information
cmuench authored Apr 16, 2024
2 parents e68702a + bf57d21 commit 350f6b4
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
2 changes: 2 additions & 0 deletions src/Deployer/Recipe/Magento2Recipe.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ public static function configuration()

\Deployer\set('artifacts_dir', 'artifacts');

\Deployer\set('artifacts_compression', 'gz');

$artifacts = [
'shop.tar.gz',
];
Expand Down
13 changes: 11 additions & 2 deletions src/Deployer/Task/BuildTasks.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,11 +104,20 @@ public static function linkEnvConfig()
*/
protected static function uploadAndExtract($tarFile)
{
$compression = \Deployer\get('artifacts_compression');
$tarOptions = '';

if ($compression === 'gz') {
$tarOptions = 'xfz';
} elseif ($compression === 'zstd') {
$tarOptions = '-I \'zstd -T0\' -xf';
}

$releasePath = '{{release_path}}';

\Deployer\upload("{{artifacts_dir}}/$tarFile", "$releasePath/$tarFile");
\Deployer\run("cd $releasePath; tar xfz $releasePath/$tarFile");
\Deployer\run("cd $releasePath; tar $tarOptions $releasePath/$tarFile");
\Deployer\run("rm $releasePath/$tarFile");
}

}
}

0 comments on commit 350f6b4

Please sign in to comment.