Add ability to use local environment variables via config/local_env.yml

This commit is contained in:
CactusPuppy 2021-02-10 17:10:18 -08:00
parent 6e745fdc67
commit 46d1b5caf5
No known key found for this signature in database
GPG key ID: 4B33B0A3E15E2C82
2 changed files with 8 additions and 0 deletions

1
.gitignore vendored
View file

@ -40,3 +40,4 @@ docker-compose.override.yml
.buildconfig
osem_development
osem_test
config/local_env.yml

View file

@ -65,5 +65,12 @@ module Osem
config.public_file_server.headers = { 'Cache-Control' => 'public, max-age=31536000' }
config.active_job.queue_adapter = :delayed_job
config.before_configuration do
env_file = File.join(Rails.root, 'config', 'local_env.yml')
YAML.load(File.open(env_file)).each do |key, value|
ENV[key.to_s] = value
end if File.exists?(env_file)
end
end
end