Sha256: 6713907ab8630f316ebbbe60038faca693d9506f001a6091ce0d2aec2ac7660f

Contents?: true

Size: 1015 Bytes

Versions: 42

Compression:

Stored size: 1015 Bytes

Contents

#!/usr/bin/env ruby

require 'thor'

require_relative '../lib/builderator/config'
require_relative '../lib/builderator/control/data'

module Builderator
  module Tasks
    ##
    # Tasks to search AWS APIs
    ##
    class Data < Thor
      def initialize(*_)
        super

        Config.load(File.join(ENV['HOME'], '.builderator/Buildfile'))
        Config.load(Util.relative_path('Buildfile').to_s)

        Config.recompile
      end

      desc 'image ', 'Search for AMIs'
      method_option 'filter', :type => :string, :aliases => :f
      method_option 'latest', :type => :boolean, :aliases => :l, :default => false
      def image(*query)
        query = Hash[*query]

        ## Load a pre-defined filter
        query['filter'] = options['filter']

        result = Control::Data.image(query)

        if options['latest']
          puts result.first.image_id
          return
        end

        puts result.map(&:image_id).join(', ')
      end
    end
  end
end

Builderator::Tasks::Data.start(ARGV)

Version data entries

42 entries across 42 versions & 1 rubygems

Version Path
builderator-2.1.1 bin/build-data
builderator-2.1.0 bin/build-data
builderator-2.0.4 bin/build-data
builderator-2.0.3 bin/build-data
builderator-2.0.2 bin/build-data
builderator-2.0.1 bin/build-data
builderator-2.0.0 bin/build-data
builderator-1.3.2 bin/build-data
builderator-1.3.1 bin/build-data
builderator-1.3.0 bin/build-data
builderator-1.2.3.pre.beta.1 bin/build-data
builderator-1.2.2 bin/build-data
builderator-1.2.1 bin/build-data
builderator-1.2.0 bin/build-data
builderator-1.1.12 bin/build-data
builderator-1.1.11 bin/build-data
builderator-1.1.10 bin/build-data
builderator-1.1.9 bin/build-data
builderator-1.1.8 bin/build-data
builderator-1.1.7 bin/build-data