github
Advanced Search
  • Home
  • Pricing and Signup
  • Explore GitHub
  • Blog
  • Login

yyyc514 / dwell forked from bousquet/dwell

  • Admin
  • Watch Unwatch
  • Fork
  • Your Fork
  • Pull Request
  • Download Source
    • 7
    • 1
  • Source
  • Commits
  • Network (1)
  • Issues (0)
  • Downloads (0)
  • Wiki (1)
  • Graphs
  • Branch: master

click here to add a description

click here to add a homepage

  • Branches (2)
    • doc
    • master ✓
  • Tags (0)
Sending Request…
Enable Donations

Pledgie Donations

Once activated, we'll place the following badge in your repository's detail box:
Pledgie_example
This service is courtesy of Pledgie.

Capistrano recipe to setup a production Rails environment on Ubuntu. — Read more

  cancel

http://github.com/bousquet/dwell

  cancel
  • Private
  • Read-Only
  • HTTP Read-Only

This URL has Read+Write access

split up rails deployment task and add a prompt before we import a db to 
prevent accidents 
Josh Goebel (author)
Wed Dec 10 12:12:37 -0800 2008
commit  88c89b0db499b65a4492fcec0b0297e4e69dc267
tree    bf3c3542f1045780fe8498acaca09d8632061c60
parent  19ae3304295fff8ace97fdba426a36595dbca8d6
dwell /
name age
history
message
file .gitignore Wed Nov 26 02:44:19 -0800 2008 Fixed typo on gemspec, ignored generated gem file [bousquet]
file LICENSE Wed Dec 03 10:43:57 -0800 2008 give me some credit too [Josh Goebel]
file README.markdown Tue Dec 09 13:32:55 -0800 2008 rake take for installing the gem by building it... [Josh Goebel]
file Rakefile Tue Dec 09 13:32:55 -0800 2008 rake take for installing the gem by building it... [Josh Goebel]
file TODO Wed Dec 03 19:52:00 -0800 2008 installation should be able to go all the way t... [Josh Goebel]
directory bin/ Tue Dec 09 12:41:31 -0800 2008 add generator support and rework some hard code... [Josh Goebel]
file dwell.gemspec Tue Dec 09 13:12:26 -0800 2008 get our dependencies right [Josh Goebel]
directory generators/ Tue Dec 09 12:41:31 -0800 2008 add generator support and rework some hard code... [Josh Goebel]
file github-test.rb Fri Dec 05 19:36:57 -0800 2008 finally, a working gemspec [Josh Goebel]
directory lib/ Wed Dec 10 12:12:37 -0800 2008 split up rails deployment task and add a prompt... [Josh Goebel]
README.markdown

DWELL - a cap recipe to setup a full Rails stack on Ubuntu

Install Capistrano2 (if you don't already have it) then build and install this gem:

$ sudo gem install capistrano
$ gem build dwell.gemspec
$ sudo gem install dwell-0.2.gem

Typical Usage

  1. Capify your Rails directory
  2. Initialize dwell inside your Rails directory (you'll want to overwrite deploy.rb)
  3. Edit your deploy.rb: configure you applications name, domain, repository, server details, etc
  4. Bootstrap your server
  5. Install the Dwell stack and any optional packages
  6. Setup your rails app and apache vhost then deploy cold

Or all said and done:

$ capify .
$ dwell init .
$ cap dwell:server:bootstrap
$ cap dwell:install
$ cap dwell:rails:setup_and_deploy_cold    

The Dwell Stack - dwell:install

  1. Updates Ubuntu sources and distro
  2. Installs Apache2
  3. Installs MySQL5
  4. Installs Subversion and Git
  5. Installs Ruby, RubyGems, Rails and Merb
  6. Installs Passenger module for Apache2
  7. Installs any specified optional packages

Optional Packages

You can specify optional packages to be installed during dwell:install in your deploy.rb file:

set :dwell_optional_installs, [:postfix, :imagemagick, :php]

Optional packages include:

  • postfix
  • mercurial
  • tinydns
  • php (sets up php via fastcig)
  • imagemagick (binary, gem, and mini-magick gem)
  • sqlite (binary and gem)

Bootstrapping

dwell:server:bootstrap

  1. Creates a user account for :user (default 'deploy') in the admin group
  2. Gives the admin group sudo rights if they haven't already
  3. Copies authorized SSH keys to the remote host (such as your own public key)
  4. Disables SSH logins for the root account since we'll be using deploy and sudo

Authorized keys should be placed in sub-directories of the authorized_keys directory. For example, if your deployment user is named "deploy" then your setup might look something like this:

config/dwell/authorized_keys/deploy/my_public_key.txt
config/dwell/authorized_keys/deploy/another_devs_public_key.txt

You can update keys anytime (add or remove) and push them to your servers. Pushing will overwrite ALL the remote keys with your new local keys.

$ cap dwell:server:push_ssh_keys

dwell:linode:bootstrap

  1. Does a dwell:server:bootstrap as show above
  2. Uses the DHCP IP assignment to configure a static IP and disable DHCP
  3. Sets up the hostname of the box from what was passed in HOSTS

You MUST pass the host (singular) in HOSTS to bootstrap a Linode as the bootstrap needs to know the hostname to properly configure the box.

HOSTS="my.new.box.com" cap dwell:linode:bootstrap

Rails Notes - dwell:rails

dwell:rails:setup_and_deploy_cold

  1. Does a traditional cap:setup
  2. Copies deploy keys (if found) to the remote host (needed for git, etc)
  3. Creates a mysql database with the authentication info in your database.yml
  4. Sets up an apache vhost and SSL keys (if you're using SSL)
  5. Deploys your code
  6. Installs any necessary app gems with rake gems:install
  7. Runs migrations
  8. Reloads Apache which should fire up your app

Optional deploy keys (public and private) should be placed in deploy_keys:

config/dwell/deploy_keys/:user.pub
config/dwell/deploy_keys/:user

Apache Notes - dwell:apache

SSL certificates (if found) will be copied and installed during setup_and_deploy_cold. You can also do this manually with cap dwell:apache:copy_certs. These same certs will referenced automatically in your apache configs if you have set :apache_ssl_enabled in your deploy.rb.

SSL certificates should be place in ssl:

config/dwell/ssl/ca/*.crt
config/dwell/ssl/*.crt
config/dwell/ssl/*.key

Any keys inside ssl/ca are assumed to be a Certificate Authority and are added to your Apache config using SSLCACertificateFile.

Blog | Support | Training | Contact | API | Status | Twitter | Help | Security
© 2010 GitHub Inc. All rights reserved. | Terms of Service | Privacy Policy
Powered by the Dedicated Servers and
Cloud Computing of Rackspace Hosting®
Dedicated Server