Skip to content

Commit

Permalink
Merge pull request #12 from AbleTech/hotfix/v0.6.3
Browse files Browse the repository at this point in the history
Tweak maintenance settings
  • Loading branch information
josephleniston committed Nov 30, 2015
2 parents 34acc65 + e39b8cf commit 009b8df
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 8 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog for easy-deployment

## 0.6.3 (2015-11-13)

Bugfixes:

* Fix maintenance page location and typos in `README.md`

## 0.6.2 (2015-11-10)

Enhancements:
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,15 +101,15 @@ All these settings are configurable, to read more see the documentation for the

### Maintenance

This includes a generator to create a maintenance mode configuration (generator is run by itself as `rails generate easy:maintenace`)
This includes a generator to create a maintenance mode configuration (generator is run by itself as `rails generate easy:maintenance`)

This will generate:

config/initializers/maintenace.rb
config/initializers/maintenance.rb
public/maintenance.html
public/maintenance.json

Customise the site configuration within `config/initializers/maintenace.rb` to change the maintenance message, response status etc.
Customise the site configuration within `config/initializers/maintenance.rb` to change the maintenance message, response status etc.
Customise the maintenance page within `public/maintenance.html`
All these settings are configurable, to read more see the documentation for the turnout gem https://github.com/biola/turnout and setup your configuration to suit yourself.

Expand Down
2 changes: 1 addition & 1 deletion lib/easy-deployment/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module Easy
module Deployment
VERSION = "0.6.2"
VERSION = "0.6.3"
end
end
2 changes: 1 addition & 1 deletion lib/easy/generators/maintenance_generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def create_maintenance_files
run("bundle install")

say("Maintenance configuration generated", :green)
say(" - TODO: edit config/maintenance.rb setting default_maintenance_page, default_reason and other configuration options", :green)
say(" - TODO: edit config/initializers/maintenance.rb setting default_maintenance_page, default_reason and other configuration options", :green)
say(" - TODO: edit public/maintenance.html to match site styles", :green)

true
Expand Down
6 changes: 3 additions & 3 deletions lib/easy/generators/templates/maintenance.rb.tt
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@
# See: https://github.com/biola/turnout#configuration for details on customization

# This is the rails root location, given this file is located at in Rails.root/config/maintenance.rb
rails_root = File.expand_path(File.join(File.dirname(__FILE__), '..'))
rails_root = File.expand_path(File.join(File.dirname(__FILE__), '../..'))


Turnout.configure do |config|
config.app_root = rails_root
config.named_maintenance_file_paths = {default: config.app_root.join('tmp', 'maintenance.yml').to_s}
config.named_maintenance_file_paths = { default: config.app_root.join('tmp', 'maintenance.yml').to_s }
config.default_maintenance_page = Turnout::MaintenancePage::HTML
config.default_reason = "The site is temporarily down for maintenance.\nPlease check back soon."
config.default_reason = "This site is temporarily down for maintenance."
config.default_allowed_paths = ['/admin','/assets']
config.default_response_code = 503
config.default_retry_after = 3600
Expand Down

0 comments on commit 009b8df

Please sign in to comment.