/config/deploy.rb
Ruby | 41 lines | 25 code | 10 blank | 6 comment | 0 complexity | 9038de76b156d879b67e0c9c99288f58 MD5 | raw file
- set :application, "genesis"
- set :repository, "git@bitbucket.org:mulligan/genesis.git"
- set :scm, :git
- set :user, "root"
- set :deploy_to, "/var/rails/genesis/"
- default_run_options[:pty] = true
- # Or: `accurev`, `bzr`, `cvs`, `darcs`, `git`, `mercurial`, `perforce`, `subversion` or `none`
- role :web, "genesis" # Your HTTP server, Apache/etc
- role :app, "genesis" # This may be the same as your `Web` server
- role :db, "genesis", :primary => true # This is where Rails migrations will run
- # if you want to clean up old releases on each deploy uncomment this:
- # after "deploy:restart", "deploy:cleanup"
- # if you're still using the script/reaper helper you will need
- # these http://github.com/rails/irs_process_scripts
- # If you are using Passenger mod_rails uncomment this:
- namespace :deploy do
- task :restart, :roles => :app, :except => { :no_release => true } do
- run "/opt/nginx/sbin/nginx -s reload"
- end
- desc "Symlink shared configs and folders on each release."
- task :symlink_shared do
- run "ln -nfs #{shared_path}/config/database.yml #{release_path}/config/database.yml"
- run "ln -nfs #{shared_path}/assets #{release_path}/public/assets"
- end
- desc "Sync the public/assets directory."
- task :assets do
- system "rsync -vr --exclude='.DS_Store' public/assets #{user}@#{application}:#{shared_path}/"
- end
- end
- after 'deploy:update_code', 'deploy:symlink_shared'
- after 'deploy:update_code', 'deploy:assets'