Skip to content

Commit bfc6ff7

Browse files
author
Jonathan Visser
committed
Disable the http:cache:warm:up step for Shopware 6.6+
1 parent 218b291 commit bfc6ff7

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

recipe/shopware.php

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,13 @@
7171
'var',
7272
]);
7373

74+
// This sets the shopware version to the version of the shopware console command.
75+
set('shopware_version', function () {
76+
$versionOutput = run('cd {{release_path}} && {{bin/console}} -V');
77+
preg_match('/(\d+\.\d+\.\d+\.\d+)/', $versionOutput, $matches);
78+
return $matches[0] ?? '6.6.0';
79+
});
80+
7481
// This task remotely executes the `cache:clear` console command on the target server.
7582
task('sw:cache:clear', static function () {
7683
run('cd {{release_path}} && {{bin/console}} cache:clear --no-warmup');
@@ -80,7 +87,11 @@
8087
// visits the website, doesn't have to wait for the cache to be built up.
8188
task('sw:cache:warmup', static function () {
8289
run('cd {{release_path}} && {{bin/console}} cache:warmup');
83-
run('cd {{release_path}} && {{bin/console}} http:cache:warm:up');
90+
91+
// Shopware 6.6+ dropped support for the http:cache:warmup command, so only execute it if the version is less than 6.6
92+
if (version_compare(get('shopware_version'), '6.6.0') < 0) {
93+
run('cd {{release_path}} && {{bin/console}} http:cache:warm:up');
94+
}
8495
});
8596

8697
// This task remotely executes the `database:migrate` console command on the target server.

0 commit comments

Comments
 (0)