You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -78,7 +80,7 @@ My [Vanilla WordPress Boilerplate](https://github.com/gaambo/vanilla-wp/) puts t
78
80
79
81
### wp-config.php
80
82
81
-
To make WordPress deployable you need to extract the host-dependent configuration (eg database access) into a seperate file which does not live in your git repository and is not deployed. I suggest using a **`wp-config-local.php`** file. This file should be required in your `wp-config.php` and be ignored by git (via `.gitignore`). This way `wp-config.php` can (should) be in your git repository and also be deployed. The default `wp/filters` configuration assumes this.
83
+
To make WordPress deployable you need to extract the host-dependent configuration (eg database access) into a seperate file which does not live in your git repository and is not deployed. I suggest using a **`wp-config-local.php`** file. This file should be required in your `wp-config.php` and be ignored by git (via `.gitignore`). This way `wp-config.php` can (should) be in your git repository and also be deployed. The default `wp/filter` configuration assumes this.
82
84
Another advantage of using a `wp-config-local.php` is to set `WP_DEBUG` on a per host basis.
83
85
84
86
### Rsync filters/excludes/includes
@@ -103,7 +105,7 @@ This can be handy to put int your custom theme or mu-plugin - for example:
103
105
- package-lock.json
104
106
```
105
107
106
-
This prevents any development files/development tools from syncing. I strongly recommend you put something like this in your custom theme and mu-plugins or overwrite any of the `themes/filters` or `mu-plugins/filters` configurations.
108
+
This prevents any development files/development tools from syncing. I strongly recommend you put something like this in your custom theme and mu-plugins or overwrite any of the `themes/filter` or `mu-plugins/filter` configurations.
107
109
108
110
## Tasks
109
111
@@ -130,7 +132,7 @@ You can also run `dep --list` to see all available tasks and their description.
130
132
-`theme:assets:build`: Run theme assets (npm) build script, can be run locally or remote
131
133
-`theme:assets`: A combined tasks to build theme assets - combines `theme:assets:vendors` and `theme:assets:build`
132
134
-`theme:vendors`: Install theme vendors (composer), can be run locally or remote
133
-
-`theme`: A combined tasks to prepare the theme - combines `theme:assets` and `theme:vendors`
135
+
-`theme`: A combined task to prepare the theme - combines `theme:assets` and `theme:vendors`
134
136
-`themes:push`: Push themes from local to remote
135
137
-`themes:pull`: Pull themes from remote to local
136
138
-`themes:sync`: Syncs themes between remote and local
@@ -156,7 +158,7 @@ You can also run `dep --list` to see all available tasks and their description.
156
158
### MU Plugin Tasks (`tasks/mu-plugins.php`)
157
159
158
160
-`mu-plugin:vendors`: Install mu-plugin vendors (composer), can be run locally or remote
159
-
-`mu-plugin`: A combined tasks - at the moment only runs mu-plugin:vendors task
161
+
-`mu-plugin`: A combined tasks to prepare the theme - at the moment only runs mu-plugin:vendors task
160
162
-`mu-plugins:push`: Push mu-plugins from local to remote
161
163
-`mu-plugins:pull`: Pull mu-plugins from remote to local
162
164
-`mu-plugins:sync`: Syncs mu-plugins between remote and local
@@ -169,6 +171,7 @@ You can also run `dep --list` to see all available tasks and their description.
169
171
-`wp:push`: Pushes WordPress core files via rsync
170
172
-`wp:pull`: Pulls WordPress core files via rsync
171
173
-`wp:info`: Runs the --info command via WP CLI - just a helper/test task
174
+
-`wp:install-wpcli`: Install the WP-CLI binary manually with the `wp:install-wpcli` task and set the path as `/bin/wp` afterwards.
172
175
173
176
#### WP-CLI
174
177
@@ -189,7 +192,7 @@ Handling and installing the WP-CLI binary can be done in one of multiple ways:
189
192
3. Set the `bin/wp` variable path on the host configuration, if WP-CLI is already installed.
190
193
4. Install the WP-CLI binary manually with the `wp:install-wpcli` task and set the path as `/bin/wp` afterwards.
191
194
You can pass the installPath, binaryFile and sudo usage via CLI:
192
-
`dep wp:install-wpcli production -o installPath='{{deploy_path}}/.bin -o binaryFile=wp -o sudo=true`
See [original PR](https://github.com/gaambo/deployer-wordpress/pull/5) for more information.
195
198
@@ -211,41 +214,60 @@ Used for standard aka default aka vanilla deployments. By default it assumes the
211
214
The recipe contains tasks for building assets for your custom theme, installing the vendors of your custom theme and installing the vendors of your custom mu-plugin (eg site-specific/core-functionality plugin).
212
215
213
216
The deployment flow is based on the default [Deployer flow](https://deployer.org/docs/flow.html) and assumes a default Deployer directory structure on the remote host.
214
-
By default this recipes overwrites the `deploy:update_code` Deployer task to deploy code via rsync instead of git - but you can change that by removing the overwrite. Or you can edit the task to just sync themes (`themes:push`) and mu-plugins (`mu-plugins:push`).
217
+
By default this recipes overwrites the `deploy:update_code` Deployer task with a `deploy:push_code` task to deploy code via rsync instead of git - but you can change that by removing the overwrite. Or you can edit the task to just sync themes (`themes:push`) and mu-plugins (`mu-plugins:push`).
215
218
216
219
#### Custom Theme
217
220
218
221
Set custom theme name (= directory) in variable `theme/name`.
219
-
By default it runs `theme:assets:vendors` and `theme:assets:build` locally and just pushes the built/dist files to the server (--> no need to install Node.js/npm on server). The `theme:assets` task (which groups the two tasks above) is hooked into _before_ `deploy:update_code`.
222
+
By default it runs `theme:assets:vendors` and `theme:assets:build` locally and just pushes the built/dist files to the server (--> no need to install Node.js/npm on server). The `theme:assets` task (which groups the two tasks above) is hooked into _before_ `deploy:push_code`.
220
223
221
-
Installing PHP/composer vendors/dependencies is done on the server. The `theme:vendors` task is therefore hooked into _after_ `deploy:update_code`.
224
+
Installing PHP/composer vendors/dependencies is done on the server. The `theme:vendors` task is therefore hooked into _after_ `deploy:push_code`.
222
225
223
226
#### Custom MU-Plugin
224
227
225
228
Set custom mu-plugin name (=directory) in variable `mu-plugin/name`.
226
-
Installing PHP/composer vendors/dependencies is done on the server. The `mu-plugin:vendors` task is therefore hooked into _after_ `deploy:update_code`.
229
+
Installing PHP/composer vendors/dependencies is done on the server. The `mu-plugin:vendors` task is therefore hooked into _after_ `deploy:push_code`.
227
230
228
231
### Simple - `deploy-simple.php`
229
232
230
233
A simple task for deploying WordPress Sites on shared hosting via rsync.
231
234
This is especially useful in case you can't put directories outside of the document root on your hosting or you don't want (for any reason) atomic deploys.
232
235
233
236
The deployment flow is based on the default [Deployer flow](https://deployer.org/docs/flow.html) but overwrites/removes some of the default `deploy:*` tasks to not create handle release directories, symlinks etc.
234
-
By default this recipes overwrites the `deploy:update_code` Deployer task to deploy code via rsync instead of git - but you can change that by removing the overwrite. Or you can edit the task to just sync themes (`themes:push`) and mu-plugins (`mu-plugins:push`).
237
+
By default this recipes overwrites the `deploy:update_code` Deployer task with a `deploy:push_code` task to deploy code via rsync instead of git - but you can change that by removing the overwrite. Or you can edit the task to just sync themes (`themes:push`) and mu-plugins (`mu-plugins:push`).
235
238
236
239
An important configuration step is to set **deploy_path**, **release_path** and **document_root** on each remote host to the same directory. This way all tasks work as usual and don't require any changes.
237
240
238
241
#### Custom Theme
239
242
240
243
Set custom theme name (= directory) in variable `theme/name`.
241
-
By default it runs `theme:assets:vendors` and `theme:assets:build` locally and just pushes the built/dist files to the server (--> no need to install Node.js/npm on server). The `theme:assets` task (which groups the two tasks above) is hooked into _before_ `deploy:update_code`.
244
+
By default it runs `theme:assets:vendors` and `theme:assets:build` locally and just pushes the built/dist files to the server (--> no need to install Node.js/npm on server). The `theme:assets` task (which groups the two tasks above) is hooked into _before_ `deploy:push_code`.
242
245
243
-
Installing PHP/composer vendors/dependencies is done on the server. The `theme:vendors` task is therefore hooked into _after_ `deploy:update_code`.
246
+
Installing PHP/composer vendors/dependencies is done on the server. The `theme:vendors` task is therefore hooked into _after_ `deploy:push_code`.
244
247
245
248
#### Custom MU-Plugin
246
249
247
250
Set custom mu-plugin name (=directory) in variable `mu-plugin/name`.
248
-
Installing PHP/composer vendors/dependencies is done on the server. The `mu-plugin:vendors` task is therefore hooked into _after_ `deploy:update_code`.
251
+
Installing PHP/composer vendors/dependencies is done on the server. The `mu-plugin:vendors` task is therefore hooked into _after_ `deploy:push_code`.
252
+
253
+
## Changelog
254
+
255
+
### v2.0.0
256
+
257
+
- Updated from Deployer 6.x to 7.x
258
+
See [docs](https://deployer.org/docs/7.x/UPGRADE#upgrade-from-6x-to-7x) for more information.
259
+
Most notable changes:
260
+
- New format for yml-files which can now also include configuration.
261
+
- The `local` is not available any more. Instead `once` and `runLocally` should be used. For theme assets the example uses a function callback and the `on` helper to optionally run those build tasks on the local host.
262
+
- When deploying you can't select a host by name or stage anymore. Instead you have to use labels (eg a `stage` label). If you've used `dep deploy production` you now have to use `dep deploy stage=production` and set the stage label in your yml file.
263
+
- Switched to a single base recipe which can be included and built upon. See `examples/deploy.php`.
264
+
- The new recipe and examples uses yml-files for project-specific configuration so the `deploy.php` is a dropin file and has no configuration in it.
265
+
- PHP 8 compatibility.
266
+
- Fixes issues with rsync flags/options and `'`.
267
+
268
+
**Upgrading:**
269
+
If you've used the default recipe it's probably easiest to copy the new example `deploy.php` and update your yml-file with project-specific configuration. If you have added any other tasks/features to your `deploy.php` make sure you upgrade them too.
270
+
If you've used most of the core functions of this library or just the examples, the upgrade should only take a few minutes.
0 commit comments