1

I was just wondering if there something similar to App_Offline.htm (it cuts all dynamic requests to the app and returns a static page) in Rails/Passenger/Capistrano to?

I am looking for the following flow when deploying to the server:

  1. Pull the source code.
  2. Take the app offline.
  3. Backup the database and (maybe some other stuff).
  4. Symlink everything.
  5. Run migrations.
  6. Minimise JS/CSS and do other processing.
  7. Restart the server.
  8. Take the app back online (revert step 2).

All is pretty easy with capistrano, except taking app offline and getting it back.

I could probably come up with a Rack application that could be plugged in when I need to take the app offline, but just wondering maybe such rack app already exists or maybe there is a better way of doing it?

Thanks.

Tim Santeford
  • 27,385
  • 16
  • 74
  • 101
Dmytrii Nagirniak
  • 23,696
  • 13
  • 75
  • 130
  • possible duplicate of [Rails App Maintenence Without Hindering Visitors](http://stackoverflow.com/questions/3361656/rails-app-maintenence-without-hindering-visitors) – Andrew Marshall Mar 29 '11 at 03:58
  • Yes. It is very similar, but I was looking for something that does not require Apache/Nginx config changes. Pure ruby would be best. – Dmytrii Nagirniak Mar 29 '11 at 04:07
  • 1
    That's probably going to be your only option. If you're updating your rails app, the rails daemon will be down for a short period. The only thing remaining up to serve a maintenance page is going to be Apache, Nginx, or whatever web server you're using. – squawknull Mar 29 '11 at 04:09
  • Makes sense. Who knows what's going to happen with Ruby while doing all the weird deployments :) Thanks guys for finding the duplicate - I could not see it initially. – Dmytrii Nagirniak Mar 29 '11 at 04:15

1 Answers1

0

It takes a bit of configuration in your web server, but Capistrano makes this pretty easy.

Capistrano to deploy rails application - how to handle long migrations?

Community
  • 1
  • 1
jdl
  • 17,702
  • 4
  • 51
  • 54
  • 1
    Thanks. But I guess you could just vote to close the question instead of answering by providing link to the other answer. We should also have *close duplicate answer* on SO :) – Dmytrii Nagirniak Mar 29 '11 at 04:13