exe/rudder in rudder-0.2.2 vs exe/rudder in rudder-0.3.0
- old
+ new
@@ -8,11 +8,11 @@
name = File.basename __FILE__
# TODO: Figure out a nice way to join these options with fly's without
# tieing them together
-options = {}
+options = { }
optparse = OptionParser.new do |opts|
opts.banner = "Usage: #{name} [options]"
opts.on('-o', '--output YAML_PATH', 'YAML_PATH to write the pipeline config') do |p|
options[:output] = p
@@ -20,10 +20,14 @@
opts.on('-c', '--config RUDDER_CONFIG', 'Path to the RUDDER_CONFIG file to evaluate') do |c|
options[:rudder] = c
end
+ opts.on('-l', '--load-vars-from CONCOURSE_VARS', 'Path to the CONCOURSE_VARS yaml file') do |v|
+ options[:vars] = v
+ end
+
opts.on('-v', '--version', 'Show version') do
options[:version] = true
end
end
optparse.parse!
@@ -37,10 +41,14 @@
puts 'Must provide RUDDER_CONFIG as option'
puts optparse.help
exit 1
end
-pipeline = Rudder.compile(options[:rudder])
+vars = {}
+vars_path = options[:vars]
+vars = YAML.load_file(vars_path) if vars_path
+
+pipeline = Rudder.compile(options[:rudder], vars: vars)
output = STDOUT
if options[:output]
output = File.open(options[:output], 'w+')
at_exit do