Skip to content

Commit d999a76

Browse files
authored
Merge pull request #51 from poespas/poespas-shopware6-disable-http-cache-warm-up-for-6.6-and-above
Disable the http:cache:warm:up step for Shopware 6.6+
2 parents 69e1101 + 91ee9c4 commit d999a76

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

recipes/shopware6.php

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,13 @@
4545
'var',
4646
]);
4747

48+
// This sets the shopware version to the version of the shopware console command.
49+
set('shopware_version', function () {
50+
$versionOutput = run('cd {{release_path}} && bin/console -V');
51+
preg_match('/(\d+\.\d+\.\d+\.\d+)/', $versionOutput, $matches);
52+
return $matches[0] ?? '6.6.0';
53+
});
54+
4855
task('sw:deploy:vendors_recovery', static function () {
4956
if (test('[ -d vendor/shopware/recovery ]')) {
5057
run('{{bin/composer}} {{composer_action}} -d vendor/shopware/recovery {{composer_options}} 2>&1');
@@ -60,7 +67,11 @@
6067
// visits the website, doesn't have to wait for the cache to be built up.
6168
task('sw:cache:warmup', static function () {
6269
run('cd {{release_path}} && bin/console cache:warmup');
63-
run('cd {{release_path}} && bin/console http:cache:warm:up');
70+
71+
// Shopware 6.6+ dropped support for the http:cache:warmup command, so only execute it if the version is less than 6.6
72+
if (version_compare(get('shopware_version'), '6.6.0', '<=')) {
73+
run('cd {{release_path}} && bin/console http:cache:warm:up');
74+
}
6475
});
6576

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

0 commit comments

Comments
 (0)