Deploying Rails applications with ShadowPuppet and Capistrano
Ruby
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
bin
lib
spec
templates
README
application_manifest.rb

README

This project is meant to be forked and modified for your own use. It illustrates
using ShadowPuppet to manage system configuration and Capistrano for deployment.

Please note:
* only works on Ubuntu 8.10
* runs on a completely clean install and assumes the user is 'rails'
* if you hate your life, blindly run on a production system.
* only installs one kind of Ruby. edit bin/bootstrap to select enterpriseyness.
* no root mysql passwd set.
* database name is 'name_production' and username is 'name'. update config/database.yml
* look at all the things you aren't giving cute names.
* you can edit passenger conf files in ./templates
* assumes a single server architecture.
* bootstrapping is slow due to compiling REE and passenger from scratch to support 64bit.
* capistrano output is crazy noisy for bootstrap. use 'cap -q'.
* use at own risk.

To get started:

1. Fork and clone this project.
2. Update shadow_rails/application_manifest.rb with your information and packages. Commit. Push.
3. Add the following to config/deploy.rb:

#############################################

# set user that can write to /u/apps and has sudo privs.
set :user, "rails"

# set your github clone url
set :shadow_repository, "git://github.com/wrecked/shadow_rails.git"

namespace :deploy do
  desc <<-DESC
  Bootstrap the system with Git, Ruby, Gems, ShadowPuppet, and ShadowFacter. Setup cap directories.
  DESC
  task :bootstrap do
    sudo "apt-get install -q -y git-core"
    run "git clone #{shadow_repository}"
    sudo '~/shadow_rails/bin/bootstrap'
  end

  desc <<-DESC
  Pull latest manifest and apply.
  DESC
  task :apply_manifest do
   	run "cd shadow_rails;git pull"
    sudo 'shadow_puppet shadow_rails/application_manifest.rb'
  end

  before :deploy do
    apply_manifest
  end

  before 'deploy:migrations' do
    apply_manifest
  end

  desc <<-DESC
  Restart the Passenger processes on the app server by touching tmp/restart.txt.
  DESC
  task :restart, :roles => :app do
    run "touch #{current_path}/tmp/restart.txt"
  end
end

#############################################

4. run 'cap -q deploy:bootstrap' to bootstrap the server.
5. run 'cap deploy' to apply manifest on the server before deploy.