Sha256: 4a2c1360ae17f3f84cf37d4cbdb7424f2c05e475c3c3498ba1d6e5dae41d907d

Contents?: true

Size: 1.98 KB

Versions: 2

Compression:

Stored size: 1.98 KB

Contents

#!/usr/bin/env ruby

require 'lambom'
require 'lambom/version'
require 'optparse'

# -e environment
# -j json_file
# -s server
# -l loglevel
# -k private_key_file
options = {}

OptionParser.new do |opts|
    opts.banner = "Usage: lambom [options]"

    opts.on("-A", "--api [API ENDPOINT URL]",
           "RIYIC Api endpoint to connect to download the server configuration") do |j|
        options[:api_url] = j
    end

    opts.on("-j", "--json [JSON FILE]",
           "Run server convergence with configuration from json attributes file") do |j|
        options[:json_file] = j
    end

    opts.on("-b", "--berksfile [BERKSFILE FILE]",
           "Use specified berksfile to download cookbooks and dependencies") do |j|
        options[:berksfile] = b
    end

    opts.on("-c", "--cached",
           "Use local cached cookbooks") do
        options[:cached] = true
    end

    opts.on("-D", "--download [TARBALL URL]",
           "Download cookbooks tarball from url and unpack it in cookbooks chef path") do |d|
        options[:download_tarball] = d
    end


    opts.on("-e", "--env [ENVIRONMENT]",
            "Select environment") do |e|
        options[:environment] = e
    end

    opts.on("-s", "--server [SERVER_UUID]",
            "Sets the server uuid to which to download configuration from RIYIC api") do |s|
        options[:server] = s
    end

    opts.on("-k", "--keyfile [PRIVATE KEYFILE]",
            "PEM Private keyfile to sign api requests") do |k|
        options[:private_key_file] = k
    end
    
    opts.on("-l","--loglevel [LOG_LEVEL]",
            "Set loglevel") do |l|
        options[:loglevel] = l
    end
    
    opts.on("-d","--debug",
            "Debug mode") do
        Lambom.enable_debug
    end
    
    opts.on_tail("-v", "--version", "Show version") do
        puts Lambom::VERSION
        exit
    end

end.parse!

out = ''
begin
    out = Lambom.run(options)
rescue Exception => e
    puts "Error: #{e.message}"
    exit 1
end

puts "Command executed successfully"

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
lambom-0.4.3 bin/lambom
lambom-0.4.2 bin/lambom