Sha256: c0c4b19a5e4193dab3e4c01c6d2c635e1580f7c2190815c74596615aea3a42db

Contents?: true

Size: 1.31 KB

Versions: 4

Compression:

Stored size: 1.31 KB

Contents

require_relative "command"
require "inspec/dist"
require "inspec/base_cli"
require "inspec/feature"

module InspecPlugins::Parallelism
  class CLI < Inspec.plugin(2, :cli_command)
    include Inspec::Dist

    subcommand_desc "parallel SUBCOMMAND [options]", "Runs #{PRODUCT_NAME} operations parallely"

    desc "exec", "Executes profile parallely"
    option :option_file, aliases: :o, type: :string, required: true,
      desc: "File that contains list of option strings"
    option :dry_run, type: :boolean,
      desc: "Print commands that will run"
    option :verbose, type: :boolean,
      desc: "Prints all thor options on dry run"
    option :jobs, aliases: :j, type: :numeric,
      desc: "Number of jobs to run parallely"
    option :ui, type: :string, default: "status",
      desc: "Which UI to use: status, text, silent"
    option :bg, type: :boolean,
      desc: "Runs parallel processes in background"
    option :log_path, type: :string,
      desc: "Path to the runner and error logs"
    exec_options
    def exec(default_profile = nil)
      Inspec.with_feature("inspec-cli-parallel-exec") {
        parallel_cmd = InspecPlugins::Parallelism::Command.new(options, default_profile)
        if options[:dry_run]
          parallel_cmd.dry_run
        else
          parallel_cmd.run
        end
      }
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
inspec-core-6.8.24 lib/plugins/inspec-parallel/lib/inspec-parallel/cli.rb
inspec-core-6.8.11 lib/plugins/inspec-parallel/lib/inspec-parallel/cli.rb
inspec-core-6.8.1 lib/plugins/inspec-parallel/lib/inspec-parallel/cli.rb
inspec-core-6.6.0 lib/plugins/inspec-parallel/lib/inspec-parallel/cli.rb