Hi all,
I've been working on making moonshine handle multiple sites on one host a bit nicer. Actually, my goal is multiple apps on multiple hosts. We have a suite of open source projects with several countries (each with their own sysadmin) using the same base code on their own servers. I'm referring to it as "moonshine multisite".
It uses capistrano-ext and a generator to create config files for each
server and stage. For example, you could have a
web app "app1" with stages "dev" and "prod"
that you want on
host.com and
mirror.com. To deploy the dev sites, you
would do "cap host/dev deploy", "cap mirror/dev
deploy".
I extended moonshine in a few places to make this
possible/easier. Probably the most major is that moonshine_multisite
looks for moonshine.yml in a number of places, from general to specific (based on your host and stage) and overrides general config options with more specific ones. I also added the ability to specify the local file in local_config and some helper tasks to download sensitive config info from a remote server.
My work is at
http://github.com/andrewroth/moonshine_multisite (scroll down on the readme to the Multisite section for more info). Since it's probably beyond the scope of moonshine, and adds complexity, I decided to change the name and am planning on maintaining it myself. However if you want to merge it back in, Jesse, I'm all for that. I know there's others using moonshine to set up a server with multiple sites so hopefully we can all benefit.
Some plans/todos:
- doesn't set up the database right now, other than copying over database.yml. I would like to private a way to at least generate default database.yml's with databases based on your app and stage that can then be easily created and seeded
- I want to add an option to set up an ubuntu machine for local development. this can be pretty similar to deploying except with git info still in the "deploy" folder (it's not really a deploy folder then, more like a check out folder)
- maybe a better way of sharing your multisite config. Right now I'm suggesting people just fork the repo and edit the moonshine_multisite.yml file in their fork. Maybe support downloading the config file from a remote server or repository
- figure out how to install multiple sites from one command/script without typing the passwords again
-Andrew Roth