Skip to content

Instantly share code, notes, and snippets.

@aslam
Forked from shreyas-satish/deploy.rake
Created September 10, 2012 13:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aslam/3691086 to your computer and use it in GitHub Desktop.
Save aslam/3691086 to your computer and use it in GitHub Desktop.
Rake task for deployment
require 'jammit'
namespace :deploy do
def run(*cmd)
system(*cmd)
raise "Command #{cmd.inspect} failed!" unless $?.success?
end
task :prod do
run "git pull"
run "bundle install"
run "bundle exec rake db:migrate"
run "cd #{Rails.root}; RAILS_ENV=production script/delayed_job restart"
run "bundle exec compass compile"
run "jammit --base-url='http://technagara.in' --force"
run "touch tmp/restart.txt"
run "curl -I http://technagara.in"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment