aegir-project / provision

The Provision CLI
http://aegirproject.org
GNU General Public License v2.0
13 stars 12 forks source link

My Provision Vision #28

Open jonpugh opened 6 years ago

jonpugh commented 6 years ago

User Experience

Self Setup

Redefine "Platform".

In Aegir, "Platforms" were treated as primary entities, separate from sites, but required to install a site.

One problem with this is that some of the most important information for a site, like it's root path, and what web server it should be running on were associated with the platform, not the site itself.

In Provision 4, I propose we make Platforms optional. Platforms are like site templates. They allow for automating the site creation by storing default information like path and code-base. Let's treat Platforms less like a primary entity and more like a way to create a site template.

We must redesign the system so that the ServerContext sets itself up, and all you have to do to get a site is add a site.

Here's how we can remove the requirement of creating the platform first:

  1. Move "publish_path", makefile, and git repo to SiteContext.
  2. Move "platform_verify" tasks to "site_verify" tasks.
  3. Remove ContextSubscriber and ContextProvider, and just have ServerContext and SiteContext.
  4. Move 'http' service to SiteContext.
  5. Change PlatformContext to not have a relationship to services at all.
  6. Allow PlatformContext code to add a property to a site, indicating that the site is using
  7. Change the UI to show Servers, Sites, and platforms separately.
  8. Allow a new platform to be created from an existing site. Allow new sites to be created on existing platforms.

Developer Experience

More to come...

helmo commented 6 years ago

When you chip away the essential properties of a platform, I see an issue coming up later add additional sites. For a third site do you get publish_path from site 1 or 2? Or will there be a 'primary' site that holds such information?

In OO fashion why not let the site class extend the platform class/interface? Then the platform level remains responsible, and the site has the info.

jonpugh commented 6 years ago

In OO fashion why not let the site class extend the platform class/interface? Then the platform level remains responsible, and the site has the info.

That's a decent idea, since the site would need all of the platform properties.

I'm not saying a site will represent a platform, I'm saying if we have a site with a publish path, makefile/gitrepo we can use those bits of info to create a platform.

jonpugh commented 6 years ago

Thanks for the tip, @helmo !

Inheriting PlatformContext was the key to making this a quick change. See PR at #32 and #30.

SiteContext has all platform properties now. If a --platform is specified on provision save, it will populate the options from the platform as if you passed them from the command line (like --root).

Works great!... Please move discussion specific to platform conversion to #30