Skip to content

Commit ff07090

Browse files
poespasJonathan Visser
andauthored
Disable the http:cache:warm:up step for Shopware 6.6+ (#4041)
* Disable the http:cache:warm:up step for Shopware 6.6+ * Add autogenerated docs for shopware_version --------- Co-authored-by: Jonathan Visser <[email protected]>
1 parent 218b291 commit ff07090

File tree

2 files changed

+38
-15
lines changed

2 files changed

+38
-15
lines changed

docs/recipe/shopware.md

Lines changed: 26 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -166,19 +166,31 @@ Please note that the files in `config/jwt/*` receive special attention in the `s
166166
```
167167

168168

169+
### shopware_version
170+
[Source](https://github.com/deployphp/deployer/blob/master/recipe/shopware.php#L75)
171+
172+
This sets the shopware version to the version of the shopware console command.
173+
174+
```php title="Default value"
175+
$versionOutput = run('cd {{release_path}} && {{bin/console}} -V');
176+
preg_match('/(\d+\.\d+\.\d+\.\d+)/', $versionOutput, $matches);
177+
return $matches[0] ?? '6.6.0';
178+
```
179+
180+
169181

170182
## Tasks
171183

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

175187

176188

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

179191

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

183195

184196

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

188200

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

192204

193205

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

196208

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

200212

201213

202214

203215

204216

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

208220

209221

210222

211223

212224

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

216228

217229

218230

219231

220232

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

224236

225237

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

229241

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

233245

234246

235247

236248

237249

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

241253

242254

243255

244256

245257

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

249261

250262

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

263275

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

267279
Deploys your project.
268280

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

280292

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

284296

285297

286298

287299

288300

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

292304

293305

294306

295307

296308

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

300312

301313

recipe/shopware.php

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,13 @@
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.
7582
task('sw:cache:clear', static function () {
7683
run('cd {{release_path}} && {{bin/console}} cache:clear --no-warmup');
@@ -80,7 +87,11 @@
8087
// visits the website, doesn't have to wait for the cache to be built up.
8188
task('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.

0 commit comments

Comments
 (0)