-
Notifications
You must be signed in to change notification settings - Fork 396
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
Multisite setup enhancements and bugfixes #2997
Conversation
… and blt site config.
…available blt.multisites values.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In testing, I also found an unrelated issue with the way users are setup in the box/config.yml https://github.com/acquia/blt/blob/9.x/src/Robo/Commands/Generate/MultisiteCommand.php#L105. That line really should 'priv' => $newDBSettings['database'] . '.*:ALL',
(notice the . in front of the *:ALL)
$site_local_hostname = $this->getConfigValue('project.local.hostname'); | ||
$sites[$site_local_hostname] = $multisite; | ||
$contents = "<?php\n \$sites = " . var_export($sites, TRUE) . ";"; | ||
file_put_contents($this->getConfigValue('docroot') . "/sites/sites.php", $contents); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doing this in the foreach loop results in the file being written repeatedly. Since the $sites variable is accreting keys in the loop, could writing the file be moved out of the loop and done a single time at the end?
@@ -80,6 +80,12 @@ public function generateSiteConfigFiles() { | |||
$default_local_drush_file = "$multisite_dir/default.local.drush.yml"; | |||
$project_local_drush_file = "$multisite_dir/local.drush.yml"; | |||
|
|||
// Generate sites.php for local multisite. | |||
$site_local_hostname = $this->getConfigValue('project.local.hostname'); | |||
$sites[$site_local_hostname] = $multisite; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's pedantic of me, but I'd like to see the $sites variable declared above the start of the loop so that the code is a bit more readable.
@@ -42,7 +42,7 @@ public function testMultisiteGenerate() { | |||
$this->assertEquals("$this->site1Dir.clone", $site1_blt_yml['drush']['aliases']['remote']); | |||
|
|||
$site2_blt_yml = YamlMunge::parseFile("$this->sandboxInstance/docroot/sites/$this->site2Dir/blt.yml"); | |||
$this->assertEquals("$this->site2Dir.local", $site2_blt_yml['drush']['aliases']['local']); | |||
$this->assertEquals("self", $site1_blt_yml['drush']['aliases']['local']); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be using $site2_blt_yml
, shouldn't it?
Updates based on review of BLT acquia#2997
Fixing a typo in privileges that caused the new user to not have expe…
This reverts commit d0da339.
* Revert "Updating CHANGELOG.md and setting version for 9.1.2." This reverts commit 5e52325. * Revert "Minor code review docs update (#3013)" This reverts commit 25e3887. * Revert "SAML Config Refactor (#2953)" This reverts commit 312d471. * Revert "Improve template/README.md (#3004)" This reverts commit 316967d. * Revert "Multisite setup enhancements and bugfixes (#2997)" This reverts commit d0da339.
Fixes #2907, #2996, #2814, #2930
Changes proposed:
blt internal:drupal:install
andblt drupal:install
Testing steps
Generate multisite site files, vm config, and settings.php config
blt multisite
. Validate that the task:vagrant reload --provision
vagrant ssh
blt setup --site=[sitename]
drush @sitename.local st
anddrush --root=path/to/docroot --uri=hostname
should return the correct site uri and site path and the database insites/[sitename]/settings/local.settings.php
should bootstrap