diff --git a/resources/build.defaults.yaml b/resources/build.defaults.yaml index 4e477f0..ae494c7 100644 --- a/resources/build.defaults.yaml +++ b/resources/build.defaults.yaml @@ -1,4 +1,7 @@ drupal: docroot: web +experimental: + useNewDatabaseCredentials: false + project_root: /app diff --git a/src/ConfigurationData.php b/src/ConfigurationData.php index 171e8c3..10bd44c 100644 --- a/src/ConfigurationData.php +++ b/src/ConfigurationData.php @@ -32,6 +32,15 @@ final class ConfigurationData )] public array $drupal; + /** + * @var array + */ + #[Assert\Collection( + allowExtraFields: false, + fields: ['useNewDatabaseCredentials' => new Assert\Type('boolean')] + )] + public array $experimental; + #[Assert\Choice(choices: ['node', 'php'])] #[Assert\NotBlank] public string $language; diff --git a/templates/env.example.twig b/templates/env.example.twig index 2b259cf..7c5ee04 100644 --- a/templates/env.example.twig +++ b/templates/env.example.twig @@ -14,7 +14,13 @@ export DOCKER_WEB_VOLUME=.:{{ project_root }} {% endif %} {% if "drupal-project" == type %} +{% if experimental.useNewDatabaseCredentials %} +export MYSQL_DATABASE=app +export MYSQL_PASSWORD=app +export MYSQL_USER=app +{% else %} export MYSQL_DATABASE=drupal export MYSQL_PASSWORD=drupal export MYSQL_USER=drupal {% endif %} +{% endif %}