-
Notifications
You must be signed in to change notification settings - Fork 2
Conversation
New tooling commands created: - lando setup-multisite # Converts a single site installation into multisite - lando add-site --slug=<slug> --title=<title> # Creates a site
After adding multisite support for subdirectory mode, it was easy to notice that it was actually the same as subdomain mode. This way we avoid needing to change url options and the domain in wp_blogs, and manually created sites will work directly without changing their url.
The site title was being created with literal quotes ("VIP Go Dev"), as --title="VIP Go Dev" was being quoted, but there was no need for that.
@@ -55,7 +55,7 @@ echo_heading "Installing WordPress $WP_VERSION" | |||
wp core install \ | |||
--path=$LANDO_WEBROOT \ | |||
--url="http://vip-go-dev.lndo.site" \ | |||
'--title="VIP Go Dev"' \ | |||
--title="VIP Go Dev" \ | |||
--admin_user="vipgo" \ |
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've removed these quotes as they were creating the WordPress site with the title "VIP Go Dev", quotes included
Do we want to be able to revert to a single site or rely on |
The process involves removing the multisite constants and (optionally) deleting the extra tables. Although, that's not a clean revert as I think the multisite process also adds some additional columns to some of the core tables as well. I think Aside: what would be interesting is the ability to have a multi-tenant version of vip-go-mu-dev so I could have multiple instances of it running (e.g. one multisite, one single site, etc.). |
Agree on not being able to go back to single site installation, using --destroy should be enough for most cases. Regarding the multi-tenant feature, I've just tested that lando can manage several projects, provided they have a different name. The proxy container is common to all of them, and it will redirect different lndo.site domains to the corresponding project (of course, these domains need to be different). But apart from that, it doesn't support managing several projects from the same directory. I see two options:
I prefer the second option, as it has a better user experience: every instance has its own separate directory (that can be easily removed, including its cloned repos), and you can use the standard lando command instead of a wrapper. |
I've pushed a quick PoC for the second option, you can find it here: #32 (and sorry for hijacking this PR) |
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.
Works great 👍
Add multisite support to the Lando dev environment.
There are two new commands:
lando setup-multisite
This will install the network and add the required tables for multisite Wordpress
lando add-site --slug=<slug> --title="<title>"
This adds a subsite that can be accessed on
http://<slug>.vip-go-dev.lndo.site/
.Note: I'm using subdomain mode for multisite as it suits better for this use case. It know we use subdirectory mode in production (although we end up setting a different domain), but I don't know if this difference can have any consequence on functionality.