class NoradServerspecRunner::Cli

Drives the CLI for norad_serverspec_runner

Public Instance Methods

local() click to toggle source
# File lib/norad_serverspec_runner/cli.rb, line 42
def local
  spectask = NoradServerspecRunner::Task.new(options[:tests], options[:results_file])
  spectask.run
end
remote(encoded_key) click to toggle source
# File lib/norad_serverspec_runner/cli.rb, line 21
def remote(encoded_key)
  spectask = NoradServerspecRunner::Task.new(options[:tests], options[:sub_tests], options[:results_file])

  spectask.host = options[:host]
  spectask.username = options[:username]
  spectask.ssh_port = options[:port]
  # Decode the key and store
  File.open(options[:sshkey], "w") do |f|
    f.write Base64.decode64(encoded_key)
  end
  spectask.sshkey = options[:sshkey]
  spectask.run
end