Skip to content

Instantly share code, notes, and snippets.

@rafaelp
Created June 7, 2011 15:30
Show Gist options
  • Save rafaelp/1012492 to your computer and use it in GitHub Desktop.
Save rafaelp/1012492 to your computer and use it in GitHub Desktop.
Rake task to deploy startupdev-ideas
namespace :heroku do
APP = 'startupdev-ideas'
def run(*cmd)
system(*cmd)
raise "Command #{cmd.inspect} failed!" unless $?.success?
end
def confirm(message)
print "\n#{message}\nAre you sure? [Yn] "
raise 'Aborted' unless STDIN.gets.chomp.downcase == 'y'
end
desc "Deploy app to Heroku"
task :deploy do
puts "-----> Pushing..."
run "git push [email protected]:#{APP}.git HEAD:master -f"
puts "-----> Migrating..."
run "heroku rake db:migrate --app #{APP}"
puts "-----> Restarting..."
run "heroku restart --app #{APP}"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment