Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Delete and Redeploy Rails app to heroku

I have a rails app that is deployed to Heroku. I recently made a ton of changes, deleted old migrations, recreated new migrations, rebased and dealt with merge conflicts....the list goes on.

Now, I want to wipe my entire heroku "production" app from heroku and redeploy my code from my github master branch to Heroku.

Is there an easy or "right" way to delete my app on Heroku, wipe it clean, and then redeploy?

like image 481
Luigi Avatar asked Feb 26 '14 13:02

Luigi


People also ask

How do I delete Heroku app from Heroku?

open your Dashboard and select the app you want to delete. Now that you are in the desired application click on the Settings tab. Scroll to the bottom of the page and click the "Delete app..." button. Follow the onscreen instructions to confirm the apps deletion.


2 Answers

Destroy the app:

heroku apps:destroy --app example

Create a new one:

heroku create example

Push to it:

git push heroku -u master

Screen grab from Heroku Tool belt

like image 87
Damien MATHIEU Avatar answered Oct 24 '22 21:10

Damien MATHIEU


If you don't want to delete the entire application (perhaps you want to keep your add-ons and other configuration the same), you can reset the database and force update the code.

Deploy your new code, forcing the update by using the -f flag:

git push heroku master -f

Drop and recreate the database:

heroku pg:reset <DATABASE>

Migrate the fresh database:

heroku run rake db:migrate
like image 34
Carlos Ramirez III Avatar answered Oct 24 '22 23:10

Carlos Ramirez III