capistrano-custom-maintenance
a customizable capistrano maintenance recipe.
this recipe has backward compatibility with original capistrano's maintenance features.
Installation
Add this line to your application's Gemfile:
gem 'capistrano-custom-maintenance'
And then execute:
$ bundle
Or install it yourself as:
$ gem install capistrano-custom-maintenance
Usage
Add following in you config/deploy.rb
.
# in "config/deploy.rb"
require 'capistrano-custom-maintenance'
Now you can entering/leaving maintenance
$ cap deploy:web:disable # <-- entering maintenance
$ cap deploy:web:enable # <-- leaving maintenance
If you prefer JSON response for maintenance page, you can do it with configuring as following.
# in "config/deploy.rb"
require 'capistrano-custom-maintenance'
set(:maintenance_content_type, 'application/json')
Following options are available to manage your maintenance.
-
:maintenance_basename
- basename of your maintenance page. usemaintenance
by default. -
:maintenance_filename
- filename of maintenance document, not including path part. -
:maintenance_suffix
- suffix of maintenance document. guessed from content-type by default. -
:maintenance_content_type
- theContent-Type
of maintenance page. usetext/html
by default. -
:maintenance_reason
- the reason of maintenance. useENV['REASON']
by default. -
:maintenance_deadline
- the deadline of maintenance. useENV['UNTIL']
by default. -
:maintenance_document_path
- the path to the maintenance page on httpd. -
:maintenance_system_path
- the path to the maintenance page. -
:maintenance_template_path
- the path to the maintenance templates. -
:maintenance_input_encoding
- encoding of maintenance page template. use system encoding by default. -
:maintenance_output_encoding
- encoding of result maintenance page. use system encoding by default.
Contributing
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Added some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request
Author
- YAMASHITA Yuu (https://github.com/yyuu)
- Geisha Tokyo Entertainment Inc. (http://www.geishatokyo.com/)
License
MIT