/config/deploy.rb
Ruby | 68 lines | 29 code | 12 blank | 27 comment | 0 complexity | 8a5c26157190238e74b385e016bccdd1 MD5 | raw file
- set :application, "seatfoo"
- set :use_sudo, false
- set :scm, :git
- set :repository, "git@bitbucket.org:h6165/seatfoo.git"
- set :branch, "master"
- set :deploy_via, :remote_cache
- set :user, "deployer"
- set :password, "deployer"
- set :deploy_to, "/home/deployer/www/seatfoo/"
- set :app_site, "50.116.3.248"
- role :web, app_site # Your HTTP server, Apache/etc
- role :app, app_site # This may be the same as your `Web` server
- role :db, app_site, :primary => true # This is where Rails migrations will run
- # bundler stuff
- #set :bundle_cmd, "/usr/local/rvm/gems/ruby-1.9.2-p290/bin/bundle"
- #set :bundle_flags, "--deployment"
- # unicorn stuff (src: https://gist.github.com/393178)
- set :rails_env, :production
- set :unicorn_cmd, "bundle exec unicorn_rails"
- set :unicorn_config, "#{current_path}/config/unicorn.rb"
- set :unicorn_pid, "#{current_path}/tmp/pids/unicorn.pid"
- # whenever stuff
- #set :whenever_command, "bundle exec whenever"
- #require "whenever/capistrano"
- namespace :deploy do
- #task :bundle, :roles => :app, :except => { :no_release => true } do
- # run "cd #{current_path} && #{bundle_cmd} install --path /home/deployer/www/shared/bundle --without development test"
- #end
-
- task :start, :roles => :app, :except => { :no_release => true } do
- # cd /home/deployer/www/seatfoo/current
- # bundle exec unicorn_rails -c config/unicorn.rb -E production -D
- run "cd #{current_path} && #{unicorn_cmd} -c #{unicorn_config} -E #{rails_env} -D"
- end
- task :stop, :roles => :app, :except => { :no_release => true } do
- # cd /home/deployer/www/seatfoo/current
- # kill -9 `cat tmp/pids/unicorn.pid`
- run "kill -9 `cat #{unicorn_pid}`"
- end
- #task :graceful_stop, :roles => :app, :except => { :no_release => true } do
- # run "#{try_sudo} kill -s QUIT `cat #{unicorn_pid}`"
- #end
- #task :reload, :roles => :app, :except => { :no_release => true } do
- # run "#{try_sudo} kill -s USR2 `cat #{unicorn_pid}`"
- #end
- task :restart, :roles => :app, :except => { :no_release => true } do
- stop
- start
- end
- end
- #namespace :rake do
- # desc "Run a task on a remote server."
- # # run like: cap rake:invoke task=a_certain_task
- # task :invoke do
- # run("cd #{current_path}; bundle exec rake #{ENV['task']} RAILS_ENV=#{rails_env}")
- # end
- #end