Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow admin password to be set by config if present. #4429

Merged
merged 3 commits into from
Feb 28, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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