Skip to content

Commit

Permalink
Allow admin password to be set by config if present. (#4429)
Browse files Browse the repository at this point in the history
* Define an account password during install if one is given.

* add config to build.yml

Co-authored-by: Pavlos Daniel <[email protected]>
Co-authored-by: Dane Powell <[email protected]>
  • Loading branch information
3 people authored Feb 28, 2022
1 parent 31f4fad commit e7de9f9
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
11 changes: 7 additions & 4 deletions config/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: [email protected]
account:
# Admin account name and password will be randomly generated unless set here.
#name: admin
#pass:
mail: [email protected]
site.mail: ${drupal.account.mail}
locale: en
local_settings_file: ${docroot}/sites/${site}/settings/local.settings.php
Expand Down
5 changes: 5 additions & 0 deletions src/Robo/Commands/Drupal/InstallCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down

0 comments on commit e7de9f9

Please sign in to comment.