ddev / ddev-addon-template

Template for DDEV add-ons.
Apache License 2.0
17 stars 17 forks source link

How to add a config.*.yaml #47

Closed simesy closed 5 months ago

simesy commented 5 months ago

I understand an addon can have a yaml that gets merged into the main config but I'm not sure how this is named/etc. I would be good to have an example in this template.

tyler36 commented 5 months ago

The only addon I regularly use with a config is https://github.com/ddev/ddev-selenium-standalone-chrome. But you can easily practise your own configs:

  1. Create a new project.
  2. Create a new config file: .ddev/config.db-port.yaml (or install the above add-on)
# .ddev/config.db-port.yaml
# Set a static DB port for the host
host_db_port: 49011
  1. Restart DDEV and search ./.ddev/.ddev-docker-compose-full.yaml for the config settings.

./.ddev/.ddev-docker-compose-full.yaml is the DDEV project; all the config associated with all the containers and services. So you can see exactly where settings are incorporated.

rfay commented 5 months ago

If you have extra config to add and install with an add-on you just

  1. Test the config.<whatever>.yaml locally - see https://ddev.readthedocs.io/en/stable/users/extend/customization-extendibility/#extending-configyaml-with-custom-configyaml-files
  2. Add the config.<whatever>.yaml to your add-on
  3. Add it to your install.yaml

Changing config as always requires a restart, so all add-ons expect a ddev restart after getting them.

simesy commented 5 months ago

Thanks, i added it to the project_files section of the install.yaml https://github.com/simesy/ddev-drupal-core-dev/blob/make-ddev-config/install.yaml#L6

tyler36 commented 5 months ago

Sorry, for some reason, I read the OP as "I don't understand how the config is merged". It's been a day.

simesy commented 5 months ago

Haha nw. My head is full so I'm just skating along :D