Sha256: e7336fa8e9422d49d44cacef0663b1e3717ea5e8526462508762683e79de4a56
Contents?: true
Size: 1.25 KB
Versions: 2
Compression:
Stored size: 1.25 KB
Contents
#!/usr/bin/env ruby # frozen_string_literal: true require 'optparse' require 'yaml' require 'rudder' name = File.basename __FILE__ # TODO: Figure out a nice way to join these options with fly's without # tieing them together 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 end 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! if options[:version] puts "Rudder Version: #{Rudder::VERSION}" exit end unless options[:rudder] puts 'Must provide RUDDER_CONFIG as option' puts optparse.help exit 1 end 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 output.close end end Rudder.dump(pipeline, output)
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
rudder-0.3.1 | exe/rudder |
rudder-0.3.0 | exe/rudder |