I know this may not be “the Bedrock way” because it decouples the management of plugins/themes/updates from Composer, but for clients where I cannot (or do not) want to maintain active management/control of their site following completion of the project I make the following modifications to bedrock at the outset of the project which subsequently allows plugins/themes/updates to be managed via the Admin yet still allows me to perform trellis deploys – without removing/overwriting plugins!
- Add the following to both
production.php
(create if necessary) andstaging.php
(if desired) files insite/config/environments/
to allow theme/plugin/updates via the Admin:Config::define('DISALLOW_FILE_MODS', false);
- Next, add the following to
trellis/roles/deploy/defaults/main.yml
under theproject_shared_children
heading (line 33 ATTOW), which will create newthemes
andplugins
directories in/srv/www/example.com/shared/
, symlinked to thethemes
andplugins
directories insite/web/app/
:project_shared_children [...] - path: web/app/plugins src: plugins - path: web/app/themes src: themes
- From the next deploy onwards all themes and plugins installed via the WordPress Admin will be written to
/srv/www/example.com/shared/[themes/plugins]
, which is retained across deployments!
- From the next deploy onwards all themes and plugins installed via the WordPress Admin will be written to
Once these changes have been implemented you can deploy at your leisure, assured that themes and plugins won’t be overwritten or removed!
Note: if you want to shim this in to an existing installation just mv
the plugins and themes from your previous release (/srv/www/example.com/releases/[release -1]/web/app/[plugins/themes]/*
) into the newly created /srv/www/example.com/shared/[themes/plugins]/
directories after deploy.