-
Notifications
You must be signed in to change notification settings - Fork 2
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 support #100
Multisite support #100
Conversation
Ahh I think I found a path forward, based on this:
Further next steps are in This code currently installs with one site, but with the properties in their newly nested location. |
…reachKeyTask classes.
…ename usages of drupal.* properties to drupal.site.*.
…when you're not running a site-specific task.
aa24e54
to
1f155f6
Compare
Ok, it's working! I have a couple of open questions with this approach:
I don't super want to address all of these things in this PR, because we might be able to tag-team these updates, but also I want to make sure that this PR doesn't prevent us from doing the right thing in other places. What do you think? |
Also, the way this works is only obliquely documented so far.
I think that covers it, but it's a lot more complicated than it used to be. I wonder if there are ways to simplify it... but it might just come down to documentation. Maybe adding some of the new |
…n update relevant tasks to depend on this target.
sites: | ||
default: | ||
build: | ||
settings: .the-build/drupal.settings.build-acquia.php |
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.
I think this needs to be settings_template
. I was building an artifact for Acquia, and it was using the local build settings template.
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.
nice catch!
@byrond -- thanks for your review so far! I'm super appreciative that you're running the artifact builds. I've made the following changes since you last looked:
I'm mostly satisfied with where this is right now. I'm going to create spin off new issues re: updating the db loading, though, since that's affected by this work, but I don't want to add even more code to this PR. |
This helps with the multisite install process, though... and it will still fail if | ||
permissions are set up properly for mysql... | ||
--> | ||
<drush command="sql-create" assume="yes" /> |
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.
Something weird is happening when running the-build-installer
now. This doesn't seem to fail on the host when there is no database server running.
example > drupal-has-database-connection:
[drush] Executing '/Users/byronduvall/example/vendor/bin/drush --nocolor --root="/Users/byronduvall/example/web" --uri="https://example.local" --config="/Users/byronduvall/example/drush/drushrc.php" sql-query "SELECT 1"'...
Query failed. [error]
[drush] Executing '/Users/byronduvall/example/vendor/bin/drush --nocolor --root="/Users/byronduvall/example/web" --uri="https://example.local" --config="/Users/byronduvall/example/drush/drushrc.php" --yes sql-create'...
[drush] Creating database drupal. Any possible existing database will be dropped!
[drush] Do you really want to continue? (y/n): y
[echo] Drupal database connection available.
Install Drupal now (y,n)?
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 seems to be a bug in Drush. The result is false
, but drush_set_error()
is never called. This also happens in drush sql-drop
, and apparently used to happen on drush sql-query
:
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.
I created a PR against Drush 8.x here: drush-ops/drush#3732
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.
OK, that one was too aggressive. See drush-ops/drush#3733
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.
A fix for this has been rolled into the 8.x branch! drush-ops/drush@97f7d2a 🎉
@becw I did some more testing of this PR, and things are working great. I only found the one quirk with |
I'm having some issues with this -- I think partly because I'm being timid about making the structural changes. What I'm expecting to do here is to move the Drupal site configuration from one location in the properties array to another.
This writeup of my current thoughts will hopefully help me figure out a next step, and be helpful for reviewers too...
Old:
New:
Aside from renaming properties where they're currently referenced, this poses a couple of issues:
drupal.sites.default.whatever
, since if there are multisites, we would also need to look atdrupal.sites.second_site.whatever
I've been thinking about a couple of ways to address these issues:
drupal.sites.default.*
todrupal.site.*
, run our tasks, then copydrupal.sites.second_site.*
todrupal.site.*
, and run the same tasks again with the new values. Code for this (CopyPropertiesTask.php
) is included in this PR.ForeachKeyTask.php
) is included in this PR.drupal.sites.default.whatever
, you could pass the prefixdrupal.sites.default.
and then values like${whatever}
in your document would be expanded. Code for this approach is included in this PR (ExpandPrefixedProperties.php
).I'm still concerned that any of these approaches introduces a lot of complexity in the default
build.xml
file -- specifically in thebuild
,install
, andbehat
targets -- that will make that file less usable to developers.To address this last issue, I'm considering a couple of approaches:
drupal.sites.*
, it would always run against that one.Other open questions...
settings.build.php
andservices.build.yml
template files be a per-site setting?