File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed
Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change 7171 'var ' ,
7272]);
7373
74+ // This sets the shopware version to the version of the shopware console command.
75+ set ('shopware_version ' , function () {
76+ $ versionOutput = run ('cd {{release_path}} && {{bin/console}} -V ' );
77+ preg_match ('/(\d+\.\d+\.\d+\.\d+)/ ' , $ versionOutput , $ matches );
78+ return $ matches [0 ] ?? '6.6.0 ' ;
79+ });
80+
7481// This task remotely executes the `cache:clear` console command on the target server.
7582task ('sw:cache:clear ' , static function () {
7683 run ('cd {{release_path}} && {{bin/console}} cache:clear --no-warmup ' );
8087// visits the website, doesn't have to wait for the cache to be built up.
8188task ('sw:cache:warmup ' , static function () {
8289 run ('cd {{release_path}} && {{bin/console}} cache:warmup ' );
83- run ('cd {{release_path}} && {{bin/console}} http:cache:warm:up ' );
90+
91+ // Shopware 6.6+ dropped support for the http:cache:warmup command, so only execute it if the version is less than 6.6
92+ if (version_compare (get ('shopware_version ' ), '6.6.0 ' ) < 0 ) {
93+ run ('cd {{release_path}} && {{bin/console}} http:cache:warm:up ' );
94+ }
8495});
8596
8697// This task remotely executes the `database:migrate` console command on the target server.
You can’t perform that action at this time.
0 commit comments