Sha256: b2563eaf574ea77e3aaee905725bc894f7f1fddb17309eb53d8d85f36c21e48e

Contents?: true

Size: 1.19 KB

Versions: 1

Compression:

Stored size: 1.19 KB

Contents

module Heirloom
  module CLI
    class Build

      def initialize(args)
        @name = args[:name]
        @id = args[:id]
        @accounts = args[:accounts]
        @bucket_prefix = args[:bucket_prefix]
        @directory = args[:directory]
        @exclude = args[:exclude].split(',')
        @public = args[:public]
        @git = args[:git]
        @logger = args[:logger]
        @artifact = Artifact.new :name   => @name,
                                 :id     => @id,
                                 :logger => @logger
      end
      
      def build
        @artifact.destroy if @artifact.exists?
                          
        file = @artifact.build :accounts       => @accounts,
                               :bucket_prefix  => @bucket_prefix,
                               :directory      => @directory,
                               :exclude        => @exclude,
                               :public         => @public,
                               :git            => @git

        @artifact.upload :bucket_prefix    => @bucket_prefix,
                         :file             => file

        @artifact.authorize unless @public

        @artifact.cleanup
      end

    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
heirloom-0.1.4 lib/heirloom/cli/build.rb