Ruby on Rails
Step 1: Add the following to your Gemfile
:
gem "skpr_config"
gem "rails_stdout_logging"
and run:
bundle install --without development test --path vendor/bundle
Step 2: Load Skpr config in config/additional_environment.rb
:
require "skpr_config"
begin
SkprConfig.load
rescue Errno::ENOENT
puts "No skpr config found"
end
Step 3: Set configuration in app/config/configuration.yml
default:
secret_token: <%= ENV["SKPR_TOKEN"] %>
email_delivery:
delivery_method: :sendmail
sendmail_settings:
location: /usr/local/bin/skprmail
Step 4: Set up database configuration in app/config/database.yml
:
common: &common
adapter: mysql2
host: <%= ENV['MYSQL_DEFAULT_HOSTNAME'] || 'db' %>
database: <%= ENV['MYSQL_DEFAULT_DATABASE'] || 'local' %>
username: <%= ENV['MYSQL_DEFAULT_USERNAME'] || 'local' %>
password: <%= ENV['MYSQL_DEFAULT_PASSWORD'] || 'local' %>
encoding: utf8mb4