Add ability to use local environment variables via config/local_env.yml
This commit is contained in:
parent
6e745fdc67
commit
46d1b5caf5
2 changed files with 8 additions and 0 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -40,3 +40,4 @@ docker-compose.override.yml
|
|||
.buildconfig
|
||||
osem_development
|
||||
osem_test
|
||||
config/local_env.yml
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue