Sha256: fe72e14c5ec72ec6a9db358280d25d5a54103348209373e58831c4a5a2be912d

Contents?: true

Size: 1.01 KB

Versions: 1

Compression:

Stored size: 1.01 KB

Contents

require 'thor'

module ConsulStockpile
  class CLI < Thor
    desc 'version', 'Print out the version string'
    def version
      require 'consul_stockpile/version'
      say ConsulStockpile::VERSION.to_s
    end

    desc 'start', 'Start the stockpile'
    option :bucket, aliases: '-b', required: true, type: :string, banner: '<s3_bucket>'
    option :name, aliases: '-n', required: true, type: :string
    option :verbose, aliases: '-v', type: :boolean, default: false
    def start
      $stdout.sync = true
      require 'consul_stockpile/run_stockpile'
      RunStockpile.call(
        bucket: options[:bucket],
        name: options[:name],
        verbose: options[:verbose]
      )
      # actors are cleaned up in at_exit handler
      exit 0
    end

    desc 'bootstrap_external_services', 'Copy external service entries from kv to catalog'
    def bootstrap_external_services
      $stdout.sync = true
      require 'consul_stockpile/bootstrap_external_services'
      BootstrapExternalServices.call!
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
consul_stockpile-0.1.5 lib/consul_stockpile/cli.rb