Skip to content

Commit bf57d21

Browse files
committed
feat: add support for zstd compression
1 parent e68702a commit bf57d21

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

src/Deployer/Recipe/Magento2Recipe.php

+2
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,8 @@ public static function configuration()
7272

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

75+
\Deployer\set('artifacts_compression', 'gz');
76+
7577
$artifacts = [
7678
'shop.tar.gz',
7779
];

src/Deployer/Task/BuildTasks.php

+11-2
Original file line numberDiff line numberDiff line change
@@ -104,11 +104,20 @@ public static function linkEnvConfig()
104104
*/
105105
protected static function uploadAndExtract($tarFile)
106106
{
107+
$compression = \Deployer\get('artifacts_compression');
108+
$tarOptions = '';
109+
110+
if ($compression === 'gz') {
111+
$tarOptions = 'xfz';
112+
} elseif ($compression === 'zstd') {
113+
$tarOptions = '-I \'zstd -T0\' -xf';
114+
}
115+
107116
$releasePath = '{{release_path}}';
108117

109118
\Deployer\upload("{{artifacts_dir}}/$tarFile", "$releasePath/$tarFile");
110-
\Deployer\run("cd $releasePath; tar xfz $releasePath/$tarFile");
119+
\Deployer\run("cd $releasePath; tar $tarOptions $releasePath/$tarFile");
111120
\Deployer\run("rm $releasePath/$tarFile");
112121
}
113122

114-
}
123+
}

0 commit comments

Comments
 (0)