Per-project DDEV config via symlinks for WordPress sites: intended usage and best practices? #8943
|
We use DDEV for a wide range of projects and would like to get some input on two scenarios where we're not sure if our approach is how DDEV is meant to be used, or if there are best practices we should follow instead. We mainly build WordPress sites. Newer projects use Bedrock, so the whole application including the DDEV configuration (a Scenario 1: Legacy sites where only the theme is in gitFor older sites, only the theme (and sometimes plugins) is version-controlled. The full site only exists on the server and is set up locally from scratch or synchronized down. To still have a per-project DDEV configuration under version control, we keep the Questions:
Scenario 2: One site, multiple themes/plugins developed in parallelSome projects have multiple themes and/or plugins that are developed in parallel. These are mostly multisites, or sites where functionality is split across several plugins instead of a single theme. Since they run as one site on one server, we also set up a single DDEV project locally. To avoid having multiple DDEV configurations, the most central theme/plugin repository holds the "main" This works fairly well. Questions:
We're happy about any input from community members with similar use cases, and ideally some insight from maintainers on whether these setups are safe long-term or likely to break when future updates don't have them in mind. This post was edited and refined with assistance from GitHub Copilot. |
Replies: 3 comments 5 replies
|
I don't really have any feedback for you, but what I do for WordPress is have the entire project in git and wp in its own subdirectory Even wp core is in version control like this. I do it because I apply patches to wp core, various plugins etc... You also can't use composer/packagist for most "premium" plugins - so I just do all updates via the WP updater. I have a custom mu plugin that creates a new commit for each plugin, theme, core or language update when triggered from the WP updater. I also have some other directories within project root with other things - experiments, some microservices etc Though, I also have a few plugins that are an actual git repo because I've cloned them from upstream to be able to make contributions to it. Perhaps I could use a submodule for that, but I find those to be cumbersome/(human) error prone It's one big monorepo. I found that works better than various distinct repos because sometimes related changes span more than one plugin etc I don't really recommend this, but just sharing what I do. It should also be noted that it's a highly custom site rather than a more typical |
|
Hi @raphaelportmann,
This isn't a supported approach, at least we don't have any tests for it.
You'll need to remove
But if
If
From what I've read, both approaches make sense.
You can share a database between projects: https://docs.ddev.com/en/stable/users/usage/managing-projects/#inter-project-communication |
|
You're pioneering great stuff, and your expertise is most important. Let us know if your basic questions are sorted out, and we're happy to continue the conversation here or in discord. As a general idea that I'm sure you'd agree with, try to get all sites completely under source control. |
Hi @raphaelportmann,
This isn't a supported approach, at least we don't have any tests for it.
You'll need to remove
name:from your theme's.ddev/config.yamlto make DDEV commands work. Read more about it here: https://docs.ddev.com/en/stable/users/configuration/config/#omit_project_name_by_default