Skip to content

Instantly share code, notes, and snippets.

@tieleman
Created April 19, 2013 12:30
Show Gist options
  • Save tieleman/5420030 to your computer and use it in GitHub Desktop.
Save tieleman/5420030 to your computer and use it in GitHub Desktop.
Snippet to deploy Rails 4. Don't use the Capistrano asset tasks.
after "deploy:restart", "deploy:cleanup"
namespace :deploy do
task :restart, :roles => :web do
run "touch #{release_path}/tmp/restart.txt"
end
task :finalize_update, :roles => :web do
run "RAILS_ENV=#{rails_env}"
run "cd #{release_path}; RAILS_ENV=#{rails_env} bundle exec rake db:migrate"
# Manually do this because Capistrano support is broken for Rails 4
run "cd #{release_path}; RAILS_ENV=#{rails_env} bundle exec rake assets:precompile"
run "chmod -R g+w #{release_path}"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment