Permalink
Browse files

Deployment improvements

  • Loading branch information...
1 parent 7a4fa64 commit 06d042460abad86a65ca2cbcba0fec1fe053b009 Vasily Ponomarev committed Oct 7, 2012
Showing with 11 additions and 1 deletion.
  1. +3 −0 Gemfile.lock
  2. +8 −1 config/deploy.rb
View
@@ -172,6 +172,8 @@ GEM
ruby_parser (2.3.1)
sexp_processor (~> 3.0)
rubyzip (0.9.8)
+ rvm-capistrano (1.2.7)
+ capistrano (>= 2.0.0)
sass (3.1.20)
sass-rails (3.2.5)
railties (~> 3.2.0)
@@ -231,6 +233,7 @@ DEPENDENCIES
rails_best_practices
rspec-rails
ruby_parser
+ rvm-capistrano
sass-rails (~> 3.2.3)
therubyracer
uglifier (>= 1.0.3)
View
@@ -47,7 +47,14 @@
set :su_rails, "sudo -u rails"
namespace :deploy do
- task :start, :roles => :app, :except => { :no_release => true } do
+ task :start, :roles => :app, :except => { :no_release => true } do
+ # Normalize permissions
+ run "mkdir #{current_path}/tmp"
+ run "#{sudo} chgrp -R rails #{current_path}/tmp"
+ run "#{sudo} chmod 775 #{current_path}/tmp"
+ run "#{sudo} chgrp -R rails #{current_path}/log"
+ run "#{sudo} chmod 775 #{current_path}/log"
+ # Launch unicorn
run "cd #{current_path} && #{su_rails} #{unicorn_binary} -c #{unicorn_config} -E #{rails_env} -D"
end
task :stop, :roles => :app, :except => { :no_release => true } do

0 comments on commit 06d0424

Please sign in to comment.