Best practice for environment specific configuration

Not applicable

In my settings.php I have (as far as I can see) two pieces of environment specific configuration

base_url (unique for each environment e.g. dev.developer.xxx.com for dev)

database connection information (unique for each environment)

Given we have a single git repo with the hosting provider what strategies can we adopt to keep environment specific config for each environment like this and have them applied correctly when we promote through dev-stage-prod?

I'm not a Drupal expert so I don't know if there are any other env specific files we need to consider. I imagine there must be an apigee config file for the Apigee edge server configuration somewhere as well.

0 3 510
3 REPLIES 3

Not applicable

Actually this is a hosting question rather than a Dev Portal one. For the EU hosting service the answers are here:

https://docs.acquia.com/acquia-cloud/develop/baseurl

https://docs.acquia.com/acquia-cloud/manage/database

Hi @a261004

If your Developer Portal is hosted at Acquia, then the best practice is to use the environment variables that Acquia has at your disposal.

You don't have to worry about the database, since Acquia handles that for you. Acquia automatically includes an environment specific settings file to handle that.

If you need to make other environment specific configurations, then use the settings.php with the environment variables, as suggested here.

On the specific case of the base_url, this other post explains how to set the base_url per environment.

I hope this helps answering your question.

Regards,

Yes I realised that after a bit more digging on the Acquia help portal. Thanks for the reply.