Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>There are TWO things you need to accomplish this, and it's not trivial.</p> <p>1) Migrations need to be backwards compatible (i.e., run while the app is live). See this article about that: <a href="http://pedro.herokuapp.com/past/2011/7/13/rails_migrations_with_no_downtime/" rel="nofollow">http://pedro.herokuapp.com/past/2011/7/13/rails_migrations_with_no_downtime/</a></p> <p>2) Deploy using TWO heroku apps. I opened a ticket with Heroku on this topic and this was their reply:</p> <blockquote> <p>We're currently working on a solution to provide a zero-downtime deploy but do not have an ETA on when this might be available.</p> <p>In the meantime a workaround that might be possible would be to deploy to two separate apps. You can push new code to the second app, spin it up, then move the domain names over to the second app. Wash and repeat on the next deploy. This is less than ideal but might get you the desired result in the interim.</p> </blockquote> <p>If you do this, you will want to automate as much as possible since there's a lot of ways to mess that up. Here's an article on that topic: <a href="http://casperfabricius.com/site/2009/09/20/manage-and-rollback-heroku-deployments-capistrano-style/" rel="nofollow">http://casperfabricius.com/site/2009/09/20/manage-and-rollback-heroku-deployments-capistrano-style/</a></p> <h2>Why?</h2> <p>These <strong>two</strong> solutions must <strong>both</strong> be done because the database migrations must work in BOTH (live and to-be-live) versions of the code. Once you have that working, THEN you can solve the second problem of having the application itself not seem like it went down. There is no supported way to spin up and spin down individual dynos once a push is started.</p> <p><strong>UPDATE:</strong> There is a beta feature available with Heroku now. To use do the following prior to pushing:</p> <p><code>heroku labs:enable -a APP_NAME preboot</code></p> <p>This will change the behavior of the app during pushes. It will push up a parallel instance that will warm up for two minutes. Almost exactly two minutes after the push, all traffic will route to the new app. Be careful with migrations, as I mentioned above, as they are still an issue.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload