CARVIEW |
Every repository with this icon (

Every repository with this icon (

Fork of ezmobius/chef-deploy | |
Description: | Chef Resources and Providers for deploying ruby web apps without capistrano edit |
Homepage: | edit |
Public Clone URL: |
git://github.com/mbailey/chef-deploy.git
Give this clone URL to anyone.
git clone git://github.com/mbailey/chef-deploy.git
|
Your Clone URL: |
Use this clone URL yourself.
git clone git@github.com:mbailey/chef-deploy.git
|
name | age | message | |
---|---|---|---|
![]() |
LICENSE | Tue Mar 24 14:23:42 -0700 2009 | first commit of chef-deploy [ezmobius] |
![]() |
README.rdoc | Loading commit data... ![]() |
|
![]() |
Rakefile | ||
![]() |
TODO | Tue Mar 24 14:23:42 -0700 2009 | first commit of chef-deploy [ezmobius] |
![]() |
lib/ |
chef-deploy
A gem that provides resources and providers for deploying ruby web apps from chef recipes
Uses the same directory layout as capistrano and steals the git remote cached deploy strategy from cap and adapts it to work without cap and under chef. Not all options are required but they are all shown here as an example.
require 'chef-deploy' deploy "/data/myrackapp" do repo "git://github.com/engineyard/rack-app.git" branch "HEAD" user "ez" role "app_master" enable_submodules true migrate true migration_command "rake db:migrate" environment "production" shallow_clone true revision '0xbeadbeef' restart_command "touch tmp/restart.txt" # "monit restart all -g foo", etc. action :deploy # or :rollback end
Chef-deploy is backwards compatible with capistrano in the fact that it uses the same exact filesystem layout. You can deploy with cap on top of a chef-deploy system and visca-versca(sic?).
Chef-deploy hooks:
If you create a APP_ROOT/deploy directory in your app you can place named hook files in there that will be triggered at the appropriate times during the deploy. the hooks are defined as follows:
APP_ROOT/
deploy/ before_migrate.rb before_symlink.rb before_restart.rb after_restart.rb
These scripts will be called with two command line params in ARGV:
ruby before_migrate.rb production app_master
Where ARGV[0] is the RAILS_ENV, MERB_ENV or RACK_ENV and ARGV[1] is the role passed in to the deploy resource, this can be used to identify certain servers as database, application, cache, etc roles so you can act accordingly
Using subversion:
In your deploy block, simply add: scm ‘subversion’ (as well as svn_username and svn_password, if needed). Obviously, git-specific options like enable_submodules can be removed as they’re not applicable.