A plugin for Moonshine
A plugin for deploying one application to multiple servers
- Install the Moonshine
- Configure servers for capistrano setting the appropriate role(s). Here is an example
config/deploy.rb
:
server 'web.example.com', :web, :primary => true server 'app.example.com', :app, :primary => true server 'db.example.com', :db, :primary => true
- Install the Moonshine Multi Server plugin:
Rails 2: script/plugin install https://github.com/railsmachine/moonshine_multi_server.git
Rails 3: script/rails plugin install https://github.com/railsmachine/moonshine_multi_server.git
- After the plugin is installed, generate some manifests!
Rails 2: script/generate moonshine:multi_server web app db Rails 3: script/rails generate moonshine:multi_server web app db
- create a manifest for each role:
app/manifests/application_manifest_.rb
app/manifests/database_manifest_.rb
app/manifests/web_manifest_.rb
- Add the stacks you need to each manifest. Here is an example
app/manifests/application_manifest.rb
:
require "#{File.dirname(__FILE__)}/../../vendor/plugins/moonshine/lib/moonshine.rb"
class ApplicationManifest < Moonshine::Manifest::Rails
include Moonshine::MultiServer
recipe :standalone_application_stack
end
- Add one bit to your capistrano
config/deploy.rb
namespace :moonshine do
task :apply do
moonshine.multi_server_apply
end
end
- Document MySQL allowed hosts
- Document
*_servers
helpers - More thorough examples
- Examples with having more than app,web,db roles
- Generator?!
script/generate moonshine_multi_server app web db
util- build capistrano servers from
*_servers
datas
Unless otherwise specified, all content copyright © 2014, Rails Machine, LLC