Skip to content

Instantly share code, notes, and snippets.

@mergulhao
Created March 21, 2012 20:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save mergulhao/2152786 to your computer and use it in GitHub Desktop.
Save mergulhao/2152786 to your computer and use it in GitHub Desktop.
Rake de deploy para o Heroku
export AMAZON_S3_BUCKET=mybucket-development
export AMAZON_ACCESS_KEY_ID=xxx
export AMAZON_SECRET_ACCESS_KEY=xxx
rvm 1.9.2@nome-da-app --create
namespace :heroku do
APP = 'nome-da-app'
def run(*cmd)
system(*cmd)
raise "Command #{cmd.inspect} failed!" unless $?.success?
end
desc "Deploy app to Heroku"
task :deploy do
puts "-----> Pushing..."
run "git push git@heroku.com:#{APP}.git HEAD:master -f"
puts "-----> Migrating..."
run "heroku run 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