mirror of
https://github.com/opdavies/build-configs.git
synced 2025-03-13 05:26:56 +00:00
feat: opt-in to the new database credentials
Allow for changing the default database name, username and password from `drupal` to `app` by enabling the `experimental.useNewDatabaseCredentials` feature flag in a project's `build.yaml` file. Refs: OD-27
This commit is contained in:
parent
bb4f630bd5
commit
fb63a6c245
|
@ -1,4 +1,7 @@
|
||||||
drupal:
|
drupal:
|
||||||
docroot: web
|
docroot: web
|
||||||
|
|
||||||
|
experimental:
|
||||||
|
useNewDatabaseCredentials: false
|
||||||
|
|
||||||
project_root: /app
|
project_root: /app
|
||||||
|
|
|
@ -32,6 +32,15 @@ final class ConfigurationData
|
||||||
)]
|
)]
|
||||||
public array $drupal;
|
public array $drupal;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var array<string,string|null>
|
||||||
|
*/
|
||||||
|
#[Assert\Collection(
|
||||||
|
allowExtraFields: false,
|
||||||
|
fields: ['useNewDatabaseCredentials' => new Assert\Type('boolean')]
|
||||||
|
)]
|
||||||
|
public array $experimental;
|
||||||
|
|
||||||
#[Assert\Choice(choices: ['node', 'php'])]
|
#[Assert\Choice(choices: ['node', 'php'])]
|
||||||
#[Assert\NotBlank]
|
#[Assert\NotBlank]
|
||||||
public string $language;
|
public string $language;
|
||||||
|
|
|
@ -14,7 +14,13 @@ export DOCKER_WEB_VOLUME=.:{{ project_root }}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% if "drupal-project" == type %}
|
{% 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_DATABASE=drupal
|
||||||
export MYSQL_PASSWORD=drupal
|
export MYSQL_PASSWORD=drupal
|
||||||
export MYSQL_USER=drupal
|
export MYSQL_USER=drupal
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
{% endif %}
|
||||||
|
|
Loading…
Reference in a new issue