Skip to content

Instantly share code, notes, and snippets.

@subelsky
Created November 27, 2013 14:28
Show Gist options
  • Save subelsky/7676549 to your computer and use it in GitHub Desktop.
Save subelsky/7676549 to your computer and use it in GitHub Desktop.
basic heroku "rake deploy" task
namespace :deploy do
task :default => [:production]
desc "check if git is clean"
task :check => "assets:check" do
unless system("git diff --exit-code")
puts "Git not clean. Aborting."
`growlnotify -m 'deployment failed'; say 'deployment failed'`
abort
end
end
desc "deploy code to production"
task :production => :check do
`git push heroku`
end
end
task :deploy => ["deploy:production"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment