A Phusion Passenger error message isn't what I want my visitors to see if they landed on my site while I'm updating the back end.
So how do I get around this? Is my deployment process flawed from the start? or is there something I'm missing out?
Here's my process of deployment, so you get the picture:
- commit new updates to a git repo and push to remote
- cap deploy
- ssh [ip]
- rake gems:install
- rake db:migrate
- cucumber
The time in between the cap deploy and the db:migrate or gems:install is when there is the error message or during longer maintenance.
An idea struck me around the head while I have been writing this: can I put these commands into my deployment recipe?
But what if maintenance is going to take an 30 mins or an hour, those commands won't solve the problem. how can I serve up a maintenance splash page to the visitor for this period of time?
thanks in advance.
You should put up a maintenance page if the application is not going to be available for a while. I use this Capistrano task:
The
app/views/admin/maintenance.html.erb
file should contain:The final step is to configure the Apache virtual host with some directives to look for the
maintenance.html
file and redirect all requests to it if it's present:To put the application into maintenance mode, run
cap deploy:web:disable
and to make it live again docap deploy:web:enable
.