Add the health_check gem end expose the health_check route
This commit is contained in:
parent
98d8e3fe9f
commit
67dc3b9c11
4 changed files with 37 additions and 0 deletions
3
Gemfile
3
Gemfile
|
@ -333,3 +333,6 @@ gem 'oauth2', '~> 1.0.0'
|
||||||
|
|
||||||
# Soft deletion
|
# Soft deletion
|
||||||
gem "paranoia", "~> 2.0"
|
gem "paranoia", "~> 2.0"
|
||||||
|
|
||||||
|
# Health check
|
||||||
|
gem 'health_check', '~> 1.5.1'
|
||||||
|
|
|
@ -402,6 +402,8 @@ GEM
|
||||||
html2haml (>= 1.0.1)
|
html2haml (>= 1.0.1)
|
||||||
railties (>= 4.0.1)
|
railties (>= 4.0.1)
|
||||||
hashie (3.4.3)
|
hashie (3.4.3)
|
||||||
|
health_check (1.5.1)
|
||||||
|
rails (>= 2.3.0)
|
||||||
highline (1.7.8)
|
highline (1.7.8)
|
||||||
hipchat (1.5.2)
|
hipchat (1.5.2)
|
||||||
httparty
|
httparty
|
||||||
|
@ -947,6 +949,7 @@ DEPENDENCIES
|
||||||
grape (~> 0.13.0)
|
grape (~> 0.13.0)
|
||||||
grape-entity (~> 0.4.2)
|
grape-entity (~> 0.4.2)
|
||||||
haml-rails (~> 0.9.0)
|
haml-rails (~> 0.9.0)
|
||||||
|
health_check (~> 1.5.1)
|
||||||
hipchat (~> 1.5.0)
|
hipchat (~> 1.5.0)
|
||||||
html-pipeline (~> 1.11.0)
|
html-pipeline (~> 1.11.0)
|
||||||
httparty (~> 0.13.3)
|
httparty (~> 0.13.3)
|
||||||
|
|
28
config/initializers/health_check.rb
Normal file
28
config/initializers/health_check.rb
Normal file
|
@ -0,0 +1,28 @@
|
||||||
|
# HealthCheck.setup do |config|
|
||||||
|
# # Text output upon success
|
||||||
|
# config.success = 'success'
|
||||||
|
#
|
||||||
|
# # Timeout in seconds used when checking smtp server
|
||||||
|
# config.smtp_timeout = 30.0
|
||||||
|
#
|
||||||
|
# # http status code used when plain text error message is output
|
||||||
|
# # Set to 200 if you want your want to distinguish between partial (text does not include success) and
|
||||||
|
# # total failure of rails application (http status of 500 etc)
|
||||||
|
# config.http_status_for_error_text = 500
|
||||||
|
#
|
||||||
|
# # http status code used when an error object is output (json or xml)
|
||||||
|
# # Set to 200 if you want your want to distinguish between partial (healthy property == false) and
|
||||||
|
# # total failure of rails application (http status of 500 etc)
|
||||||
|
# config.http_status_for_error_object = 500
|
||||||
|
#
|
||||||
|
# # You can customize which checks happen on a standard health check
|
||||||
|
# config.standard_checks = [ 'database', 'migrations', 'custom' ]
|
||||||
|
#
|
||||||
|
# # You can set what tests are run with the 'full' or 'all' parameter
|
||||||
|
# config.full_checks = ['database', 'migrations', 'custom', 'email', 'cache']
|
||||||
|
#
|
||||||
|
# # Add one or more custom checks that return a blank string if ok, or an error message if there is an error
|
||||||
|
# config.add_custom_check do
|
||||||
|
# any code that returns blank on success and non blank string upon failure
|
||||||
|
# end
|
||||||
|
# end
|
|
@ -73,6 +73,9 @@ Rails.application.routes.draw do
|
||||||
mount Sidekiq::Web, at: '/admin/sidekiq', as: :sidekiq
|
mount Sidekiq::Web, at: '/admin/sidekiq', as: :sidekiq
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# Health check
|
||||||
|
health_check_routes
|
||||||
|
|
||||||
# Enable Grack support
|
# Enable Grack support
|
||||||
mount Grack::AuthSpawner, at: '/', constraints: lambda { |request| /[-\/\w\.]+\.git\//.match(request.path_info) }, via: [:get, :post, :put]
|
mount Grack::AuthSpawner, at: '/', constraints: lambda { |request| /[-\/\w\.]+\.git\//.match(request.path_info) }, via: [:get, :post, :put]
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue