Skip to content

Commit

Permalink
EmrEtlRunner & StorageLoader: supported environment variables in YAML…
Browse files Browse the repository at this point in the history
… config files (snowplow/snowplow#1215)
  • Loading branch information
fblundun authored and chuwy committed Sep 5, 2017
1 parent fa11cf9 commit aabfd48
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions lib/snowplow-storage-loader/config.rb
Expand Up @@ -16,6 +16,7 @@
require 'optparse'
require 'date'
require 'yaml'
require 'erb'
require 'sluice'

# Config module to hold functions related to CLI argument parsing
Expand All @@ -36,12 +37,14 @@ def get_config()
options = Config.parse_args()

if Config.indicates_read_from_stdin?(options[:config])
unsymbolized_config = YAML.load($stdin.readlines.join)
unsymbolized_config = $stdin.readlines.join
else
unsymbolized_config = YAML.load_file(options[:config])
unsymbolized_config = File.new(options[:config]).read
end

config = Config.recursive_symbolize_keys(unsymbolized_config)
erb_config = ERB.new(unsymbolized_config).result(binding)

config = Config.recursive_symbolize_keys(YAML.load(erb_config))


# Add in our skip and include settings
Expand Down

0 comments on commit aabfd48

Please sign in to comment.