Skip to content
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