-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Individual changes reviewed to ensure that application behaviour is maintained and any obsolete configuration options are removed.
- Loading branch information
Showing
12 changed files
with
196 additions
and
117 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
#!/usr/bin/env ruby | ||
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__) | ||
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__) | ||
load Gem.bin_path('bundler', 'bundle') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#!/usr/bin/env ruby | ||
require 'fileutils' | ||
include FileUtils | ||
|
||
# path to your application root. | ||
APP_ROOT = File.expand_path('..', __dir__) | ||
|
||
def system!(*args) | ||
system(*args) || abort("\n== Command #{args} failed ==") | ||
end | ||
|
||
chdir APP_ROOT do | ||
# This script is a starting point to setup your application. | ||
# Add necessary setup steps to this file. | ||
|
||
puts '== Installing dependencies ==' | ||
system! 'gem install bundler --conservative' | ||
system('bundle check') || system!('bundle install') | ||
|
||
# Install JavaScript dependencies if using Yarn | ||
# system('bin/yarn') | ||
|
||
puts "\n== Removing old logs and tempfiles ==" | ||
system! 'bin/rails log:clear tmp:clear' | ||
|
||
puts "\n== Restarting application server ==" | ||
system! 'bin/rails restart' | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#!/usr/bin/env ruby | ||
require 'fileutils' | ||
include FileUtils | ||
|
||
# path to your application root. | ||
APP_ROOT = File.expand_path('..', __dir__) | ||
|
||
def system!(*args) | ||
system(*args) || abort("\n== Command #{args} failed ==") | ||
end | ||
|
||
chdir APP_ROOT do | ||
# This script is a way to update your development environment automatically. | ||
# Add necessary update steps to this file. | ||
|
||
puts '== Installing dependencies ==' | ||
system! 'gem install bundler --conservative' | ||
system('bundle check') || system!('bundle install') | ||
|
||
# Install JavaScript dependencies if using Yarn | ||
# system('bin/yarn') | ||
|
||
puts "\n== Removing old logs and tempfiles ==" | ||
system! 'bin/rails log:clear tmp:clear' | ||
|
||
puts "\n== Restarting application server ==" | ||
system! 'bin/rails restart' | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!/usr/bin/env ruby | ||
APP_ROOT = File.expand_path('..', __dir__) | ||
Dir.chdir(APP_ROOT) do | ||
begin | ||
exec "yarnpkg", *ARGV | ||
rescue Errno::ENOENT | ||
$stderr.puts "Yarn executable was not detected in the system." | ||
$stderr.puts "Download Yarn at https://yarnpkg.com/en/docs/install" | ||
exit 1 | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,73 +1,92 @@ | ||
Rails.application.configure do | ||
# Settings specified here will take precedence over those in config/application.rb. | ||
|
||
# Set GOVUK_ASSET_ROOT & PLEK_SERVICE_STATIC_URI for heroku - for review | ||
# apps we have the hostname set at the time of the app being built so can't | ||
# be set up in the app.json | ||
if ENV["HEROKU_APP_NAME"] | ||
ENV["ASSET_HOST"] = "#{ENV['HEROKU_APP_NAME']}.herokuapp.com" unless ENV.include?("ASSET_HOST") | ||
ENV["PLEK_SERVICE_STATIC_URI"] = "#{ENV['HEROKU_APP_NAME']}.herokuapp.com" unless ENV.include?("PLEK_SERVICE_STATIC_URI") | ||
end | ||
|
||
# Code is not reloaded between requests | ||
# Code is not reloaded between requests. | ||
config.cache_classes = true | ||
|
||
# Full error reports are disabled and caching is turned on | ||
# Eager load code on boot. This eager loads most of Rails and | ||
# your application in memory, allowing both threaded web servers | ||
# and those relying on copy on write to perform better. | ||
# Rake tasks automatically ignore this option for performance. | ||
config.eager_load = true | ||
|
||
# Full error reports are disabled and caching is turned on. | ||
config.consider_all_requests_local = false | ||
config.action_controller.perform_caching = true | ||
|
||
# Disable Rails's static asset server (Apache or nginx will already do this) | ||
config.serve_static_files = ENV["RAILS_SERVE_STATIC_FILES"].present? | ||
# Ensures that a master key has been made available in either ENV["RAILS_MASTER_KEY"] | ||
# or in config/master.key. This key is used to decrypt credentials (and other encrypted files). | ||
# config.require_master_key = true | ||
|
||
# Disable serving static files from the `/public` folder by default since | ||
# Apache or NGINX already handles this. | ||
config.public_file_server.enabled = ENV["RAILS_SERVE_STATIC_FILES"].present? | ||
|
||
# Compress JavaScripts and CSS | ||
# Compress JavaScripts and CSS. | ||
config.assets.js_compressor = :uglifier | ||
# config.assets.css_compressor = :sass | ||
|
||
# Don't fallback to assets pipeline if a precompiled asset is missed | ||
# Do not fallback to assets pipeline if a precompiled asset is missed. | ||
config.assets.compile = false | ||
|
||
# Generate digests for assets URLs | ||
config.assets.digest = true | ||
# `config.assets.precompile` and `config.assets.version` have moved to config/initializers/assets.rb | ||
|
||
# Defaults to Rails.root.join("public/assets") | ||
# config.assets.manifest = YOUR_PATH | ||
# Enable serving of images, stylesheets, and JavaScripts from an asset server. | ||
# config.action_controller.asset_host = 'http://assets.example.com' | ||
|
||
# Specifies the header that your server uses for sending files | ||
# config.action_dispatch.x_sendfile_header = "X-Sendfile" # for apache | ||
# config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for nginx | ||
# Specifies the header that your server uses for sending files. | ||
# config.action_dispatch.x_sendfile_header = 'X-Sendfile' # for Apache | ||
# config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for NGINX | ||
|
||
# Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies. | ||
# config.force_ssl = true | ||
|
||
# See everything in the log | ||
# Use the lowest log level to ensure availability of diagnostic information | ||
# when problems arise. | ||
config.log_level = :info | ||
|
||
# Use a different logger for distributed setups | ||
# config.logger = SyslogLogger.new | ||
# Prepend all log lines with the following tags. | ||
# config.log_tags = [ :request_id ] | ||
|
||
# Use a different cache store in production | ||
# Use a different cache store in production. | ||
# config.cache_store = :mem_cache_store | ||
|
||
# Precompile additional assets (application.js, application.css, and all non-JS/CSS are already added) | ||
# config.assets.precompile += %w( ie.js libs/jquery/jquery-1.12.4.min.js high-contrast.css dyslexic.css admin.css libs/jquery/jquery-ui-1.8.16.custom.min.js libs/jquery/plugins/jquery.mustache.js ) | ||
|
||
# Disable delivery errors, bad email addresses will be ignored | ||
# config.action_mailer.raise_delivery_errors = false | ||
# config.action_mailer.delivery_method = :ses | ||
|
||
# Enable threaded mode | ||
# config.threadsafe! | ||
# Use a real queuing backend for Active Job (and separate queues per environment) | ||
# config.active_job.queue_adapter = :resque | ||
# config.active_job.queue_name_prefix = "static_#{Rails.env}" | ||
|
||
# Enable locale fallbacks for I18n (makes lookups for any locale fall back to | ||
# the I18n.default_locale when a translation can not be found) | ||
# the I18n.default_locale when a translation cannot be found). | ||
config.i18n.fallbacks = true | ||
|
||
# Send deprecation notices to registered listeners | ||
# Send deprecation notices to registered listeners. | ||
config.active_support.deprecation = :notify | ||
|
||
config.action_controller.asset_host = ENV["ASSET_HOST"] || ENV["GOVUK_ASSET_ROOT"] | ||
# Use default logging formatter so that PID and timestamp are not suppressed. | ||
config.log_formatter = ::Logger::Formatter.new | ||
|
||
config.eager_load = true | ||
# Use a different logger for distributed setups. | ||
# require 'syslog/logger' | ||
# config.logger = ActiveSupport::TaggedLogging.new(Syslog::Logger.new 'app-name') | ||
|
||
if ENV["RAILS_LOG_TO_STDOUT"].present? | ||
logger = ActiveSupport::Logger.new(STDOUT) | ||
logger.formatter = config.log_formatter | ||
config.logger = ActiveSupport::TaggedLogging.new(logger) | ||
end | ||
|
||
# Allow overriding the asset host with an environment variable. | ||
config.action_controller.asset_host = ENV["ASSET_HOST"] || ENV["GOVUK_ASSET_ROOT"] | ||
|
||
# Google Analytics ID | ||
config.ga_universal_id = ENV.fetch("GA_UNIVERSAL_ID", "UA-26179049-1") | ||
config.ga_secondary_id = ENV.fetch("GA_SECONDARY_ID", "UA-145652997-1") | ||
|
||
# Set GOVUK_ASSET_ROOT & PLEK_SERVICE_STATIC_URI for heroku - for review | ||
# apps we have the hostname set at the time of the app being built so can't | ||
# be set up in the app.json | ||
if ENV["HEROKU_APP_NAME"] | ||
ENV["ASSET_HOST"] = "#{ENV['HEROKU_APP_NAME']}.herokuapp.com" unless ENV.include?("ASSET_HOST") | ||
ENV["PLEK_SERVICE_STATIC_URI"] = "#{ENV['HEROKU_APP_NAME']}.herokuapp.com" unless ENV.include?("PLEK_SERVICE_STATIC_URI") | ||
end | ||
end |
Oops, something went wrong.