mattpolito/paratrooper — pull request #39 by jgdavey (2013-08-04 18:25:58+00:00)
Title: Add 'use_maintenance_mode' option

There are often deployments that require no database migrations or other
potentially race-condition-inducing issues. For these rare times, doing
a deploy with no downtime is acceptable, and can happen transparently to
users.

Because this is potentially dangerous, the recommendation is to use an
opt-out environment variable to deploy without maintenance mode,
defaulting to always use it. Using such a variable, the following
scenarios would be possible:

$ rake deploy # deploys using maintenance mode
$ NO_MAINTENANCE=1 rake deploy # deploys without maintenance mode

One could achieve the above with a setup like:

Paratrooper::Deploy.new("amazing-production-app",
use_maintenance_mode: !ENV['NO_MAINTENANCE']
)