Problem/Motivation
I’m pretty new to trying out Drupal CMS, but not new to Drupal sites with DDEV. I am definitely not liking that running ddev composer create-project drupal/cms blows away my .ddev/config.yaml file and replaces it with its own bare bones one. I deliberately run ddev config with my own needed parameters for db, php, and webserver and I like to be able to see them in config.yaml.
Is there anything I can do to prevent this from happening?
Steps to reproduce
ddev config --project-type=drupal11 --docroot=web --database=mysql:8.0 --webserver-type=apache-fpm --php-version=8.3
My full config.yaml file exists.
ddev start
ddev composer create-project drupal/cms
My config.yaml file has been replaced. And running ddev config --auto cannot restore it.
Proposed resolution
User interface changes
Configuration changes
Comments
Comment #2
phenaproximaNice find. I can't think of anything you can do to prevent this, but I think we should fix it.
The purpose of including a
.ddev/config.yamlin the first place was to make our first-start instructions consistent in release notes and the README, and to make it so that people can download the Drupal CMS zip file and runddev launchto get going. But you're right, that does break it for people who take the slightly longer way around, and configure DDEV before runningddev composer create-project, as documented in DDEV's quick-start for Drupal CMS.So I think the solution here is to only add the
.ddev/config.yamlto the ZIP package. We can do that by altering ourdrupal.org releaseGitLab CI job, which builds the ZIP file: https://git.drupalcode.org/project/drupal_cms/-/blob/2.x/.gitlab-ci.yml?....Therefore, the changes we need here are:
project_template/.ddev/config.yamltoproject_template/assets/ddev-config.yaml*create-projectstep, we'll want tomv cms/assets/ddev-config.ymltocms/.ddev/config.yamlyqcommand which adjust the config file from.ddev/commands/web/tag.A side effect of this is that the cPanel-compatible variant of the project template will no longer have default configuration for DDEV. Given who that variant is for, and how we expect it to be used, that's fine.
The end result here should be:
ddev launch, no questions asked.ddev composer create-project, your existing configuration should be preserved.Comment #4
pameeela commentedI agree this is fine, we even already include
ddev config --project-type=drupal11 --docroot=webin the steps to get started in the drupal/cms project. So this doesn't really change anything.Comment #5
phenaproximaDid a bit of due diligence here and I see that the dist ZIP file used by Packagist (
composer create-project drupal/cms) is not the same one that gets attached to the release node, which is from ourdrupal.org releaseCI job.That's good. It means that people who follow DDEV's quick-start instructions for Drupal CMS should not have their config.yaml overridden inadvertently: the only people who will get the canned config.yaml really and truly should be the ones who download the ZIP file from the release node.