PageRenderTime 53ms CodeModel.GetById 27ms RepoModel.GetById 1ms app.codeStats 0ms

/config/deploy.rb

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