diff --git a/config/build.yml b/config/build.yml index f1587a1ac..6a1de41d6 100644 --- a/config/build.yml +++ b/config/build.yml @@ -54,13 +54,16 @@ deploy: exclude_additions_file: ${repo.root}/blt/deploy-exclude-additions.txt gitignore_file: ${blt.root}/scripts/blt/deploy/.gitignore -# File and Directory locations. +# Drupal docroot. docroot: ${repo.root}/docroot -# Drupal Account Credentials. These are used for installing Drupal. +# Settings for installing Drupal. drupal: - #account.name: admin - account.mail: no-reply@example.com + account: + # Admin account name and password will be randomly generated unless set here. + #name: admin + #pass: + mail: no-reply@example.com site.mail: ${drupal.account.mail} locale: en local_settings_file: ${docroot}/sites/${site}/settings/local.settings.php diff --git a/src/Robo/Commands/Drupal/InstallCommand.php b/src/Robo/Commands/Drupal/InstallCommand.php index 17593c54e..e970c852c 100644 --- a/src/Robo/Commands/Drupal/InstallCommand.php +++ b/src/Robo/Commands/Drupal/InstallCommand.php @@ -120,6 +120,11 @@ function ($string) { ->verbose(TRUE) ->printOutput(TRUE); + // Allow installs to define a custom user 1 password. + if ($this->getConfigValue('drupal.account.pass') !== NULL) { + $task->option('account-pass', $this->getConfigValue('drupal.account.pass')); + } + // Install site from existing config if supported. $strategy = $this->getConfigValue('cm.strategy'); $install_from_config = $this->getConfigValue('cm.core.install_from_config');