Skip to content

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

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
Show file tree
Hide file tree
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
40 changes: 26 additions & 14 deletions docs/recipe/shopware.md
Original file line number Diff line number Diff line change
Expand Up @@ -166,19 +166,31 @@ Please note that the files in `config/jwt/*` receive special attention in the `s
```


### shopware_version
[Source](https://github.com/deployphp/deployer/blob/master/recipe/shopware.php#L75)

This sets the shopware version to the version of the shopware console command.

```php title="Default value"
$versionOutput = run('cd {{release_path}} && {{bin/console}} -V');
preg_match('/(\d+\.\d+\.\d+\.\d+)/', $versionOutput, $matches);
return $matches[0] ?? '6.6.0';
```



## Tasks

### sw\:cache\:clear {#sw-cache-clear}
[Source](https://github.com/deployphp/deployer/blob/master/recipe/shopware.php#L75)
[Source](https://github.com/deployphp/deployer/blob/master/recipe/shopware.php#L82)



This task remotely executes the `cache:clear` console command on the target server.


### sw\:cache\:warmup {#sw-cache-warmup}
[Source](https://github.com/deployphp/deployer/blob/master/recipe/shopware.php#L81)
[Source](https://github.com/deployphp/deployer/blob/master/recipe/shopware.php#L88)



Expand All @@ -187,39 +199,39 @@ visits the website, doesn't have to wait for the cache to be built up.


### sw\:database\:migrate {#sw-database-migrate}
[Source](https://github.com/deployphp/deployer/blob/master/recipe/shopware.php#L87)
[Source](https://github.com/deployphp/deployer/blob/master/recipe/shopware.php#L98)



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


### sw\:plugin\:refresh {#sw-plugin-refresh}
[Source](https://github.com/deployphp/deployer/blob/master/recipe/shopware.php#L91)
[Source](https://github.com/deployphp/deployer/blob/master/recipe/shopware.php#L102)






### sw\:scheduled-task\:register {#sw-scheduled-task-register}
[Source](https://github.com/deployphp/deployer/blob/master/recipe/shopware.php#L95)
[Source](https://github.com/deployphp/deployer/blob/master/recipe/shopware.php#L106)






### sw\:theme\:refresh {#sw-theme-refresh}
[Source](https://github.com/deployphp/deployer/blob/master/recipe/shopware.php#L99)
[Source](https://github.com/deployphp/deployer/blob/master/recipe/shopware.php#L110)






### sw\:theme\:compile {#sw-theme-compile}
[Source](https://github.com/deployphp/deployer/blob/master/recipe/shopware.php#L105)
[Source](https://github.com/deployphp/deployer/blob/master/recipe/shopware.php#L116)



Expand All @@ -228,23 +240,23 @@ to build the theme remotely instead of locally.


### sw\:plugin\:update\:all {#sw-plugin-update-all}
[Source](https://github.com/deployphp/deployer/blob/master/recipe/shopware.php#L117)
[Source](https://github.com/deployphp/deployer/blob/master/recipe/shopware.php#L128)






### sw\:writable\:jwt {#sw-writable-jwt}
[Source](https://github.com/deployphp/deployer/blob/master/recipe/shopware.php#L127)
[Source](https://github.com/deployphp/deployer/blob/master/recipe/shopware.php#L138)






### sw\:deploy {#sw-deploy}
[Source](https://github.com/deployphp/deployer/blob/master/recipe/shopware.php#L134)
[Source](https://github.com/deployphp/deployer/blob/master/recipe/shopware.php#L145)



Expand All @@ -262,7 +274,7 @@ This task is group task which contains next tasks:


### deploy {#deploy}
[Source](https://github.com/deployphp/deployer/blob/master/recipe/shopware.php#L145)
[Source](https://github.com/deployphp/deployer/blob/master/recipe/shopware.php#L156)

Deploys your project.

Expand All @@ -279,23 +291,23 @@ This task is group task which contains next tasks:


### sw-build-without-db\:get-remote-config {#sw-build-without-db-get-remote-config}
[Source](https://github.com/deployphp/deployer/blob/master/recipe/shopware.php#L164)
[Source](https://github.com/deployphp/deployer/blob/master/recipe/shopware.php#L175)






### sw-build-without-db\:build {#sw-build-without-db-build}
[Source](https://github.com/deployphp/deployer/blob/master/recipe/shopware.php#L177)
[Source](https://github.com/deployphp/deployer/blob/master/recipe/shopware.php#L188)






### sw-build-without-db {#sw-build-without-db}
[Source](https://github.com/deployphp/deployer/blob/master/recipe/shopware.php#L181)
[Source](https://github.com/deployphp/deployer/blob/master/recipe/shopware.php#L192)



Expand Down
13 changes: 12 additions & 1 deletion recipe/shopware.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,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';
});

// This task remotely executes the `cache:clear` console command on the target server.
task('sw:cache:clear', static function () {
run('cd {{release_path}} && {{bin/console}} cache:clear --no-warmup');
Expand All @@ -80,7 +87,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.
Expand Down