Skip to content

Disable the http:cache:warm:up step for Shopware 6.6+ #51

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion recipes/shopware6.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand All @@ -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', '<=')) {
run('cd {{release_path}} && bin/console http:cache:warm:up');
}
});

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