From 79f0dd69560bb14174364dc4b65af790695c2b11 Mon Sep 17 00:00:00 2001 From: Jonathan Visser Date: Mon, 24 Mar 2025 12:57:58 +0100 Subject: [PATCH 1/3] Disable the http:cache:warm:up step for Shopware 6.6+ --- recipes/shopware6.php | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/recipes/shopware6.php b/recipes/shopware6.php index 6cc199f..ac3098e 100644 --- a/recipes/shopware6.php +++ b/recipes/shopware6.php @@ -45,6 +45,13 @@ 'var', ]); +// This sets the shopware version to the version of the shopware console command. +set('shopware_version', function () { + $versionOutput = run('cd {{release_path}} && bin/console -V'); + preg_match('/(\d+\.\d+\.\d+\.\d+)/', $versionOutput, $matches); + return $matches[0] ?? '6.6.0'; +}); + task('sw:deploy:vendors_recovery', static function () { if (test('[ -d vendor/shopware/recovery ]')) { run('{{bin/composer}} {{composer_action}} -d vendor/shopware/recovery {{composer_options}} 2>&1'); @@ -60,7 +67,11 @@ // visits the website, doesn't have to wait for the cache to be built up. task('sw:cache:warmup', static function () { run('cd {{release_path}} && bin/console cache:warmup'); - run('cd {{release_path}} && bin/console http:cache:warm:up'); + + // Shopware 6.6+ dropped support for the http:cache:warmup command, so only execute it if the version is less than 6.6 + if (version_compare(get('shopware_version'), '6.6.0') < 0) { + run('cd {{release_path}} && bin/console http:cache:warm:up'); + } }); // This task remotely executes the `database:migrate` console command on the target server. From 93ec28f64f2f73bb38ce3712c6739e505f4b1eb5 Mon Sep 17 00:00:00 2001 From: Jonathan Date: Mon, 24 Mar 2025 14:29:13 +0100 Subject: [PATCH 2/3] Update recipes/shopware6.php Co-authored-by: Timon de Groot --- recipes/shopware6.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/shopware6.php b/recipes/shopware6.php index ac3098e..9c199ff 100644 --- a/recipes/shopware6.php +++ b/recipes/shopware6.php @@ -69,7 +69,7 @@ run('cd {{release_path}} && bin/console cache:warmup'); // Shopware 6.6+ dropped support for the http:cache:warmup command, so only execute it if the version is less than 6.6 - if (version_compare(get('shopware_version'), '6.6.0') < 0) { + if (version_compare(get('shopware_version'), '6.6.0', '<')) { run('cd {{release_path}} && bin/console http:cache:warm:up'); } }); From 91ee9c495fda66cd9dfcca6acac07eab6dcf1777 Mon Sep 17 00:00:00 2001 From: Jonathan Visser Date: Mon, 24 Mar 2025 14:32:45 +0100 Subject: [PATCH 3/3] Set <= as operator --- recipes/shopware6.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/shopware6.php b/recipes/shopware6.php index 9c199ff..696402a 100644 --- a/recipes/shopware6.php +++ b/recipes/shopware6.php @@ -69,7 +69,7 @@ run('cd {{release_path}} && bin/console cache:warmup'); // Shopware 6.6+ dropped support for the http:cache:warmup command, so only execute it if the version is less than 6.6 - if (version_compare(get('shopware_version'), '6.6.0', '<')) { + if (version_compare(get('shopware_version'), '6.6.0', '<=')) { run('cd {{release_path}} && bin/console http:cache:warm:up'); } });