Sha256: a26316e8846e4da3a58b4f4bd4ac08764b853bff3bd5eff344021e52bc3ff5d2

Contents?: true

Size: 981 Bytes

Versions: 32

Compression:

Stored size: 981 Bytes

Contents

module SimpleDeploy
  class Artifact

    def initialize(args)
      @bucket_prefix = args[:bucket_prefix]
      @id            = args[:id]
      @name          = args[:name]
      @region        = args[:region]
      @domain        = args[:domain]
      @encrypted     = args[:encrypted]

      @bucket = "#{@bucket_prefix}-#{@region}"
      @key = @encrypted ? "#{@id}.tar.gz.gpg" : "#{@id}.tar.gz"
    end

    def endpoints
      { 's3' => s3_url, 'http' => http_url, 'https' => https_url }
    end

    private

    def s3_url
      "s3://#{@bucket}/#{@domain}/#{@key}"
    end

    def http_url
      "http://#{s3_endpoints[@region]}/#{@bucket}/#{@domain}/#{@key}"
    end

    def https_url
      "https://#{s3_endpoints[@region]}/#{@bucket}/#{@domain}/#{@key}"
    end

    def s3_endpoints
      {
        'us-east-1' => 's3.amazonaws.com',
        'us-west-1' => 's3-us-west-1.amazonaws.com',
        'us-west-2' => 's3-us-west-2.amazonaws.com'
      }
    end
  end
end

Version data entries

32 entries across 32 versions & 1 rubygems

Version Path
simple_deploy-0.10.2 lib/simple_deploy/artifact.rb
simple_deploy-0.10.1 lib/simple_deploy/artifact.rb
simple_deploy-0.10.0 lib/simple_deploy/artifact.rb
simple_deploy-0.10.0.beta.3 lib/simple_deploy/artifact.rb
simple_deploy-0.10.0.beta.2 lib/simple_deploy/artifact.rb
simple_deploy-0.10.0.beta.1 lib/simple_deploy/artifact.rb
simple_deploy-0.9.2 lib/simple_deploy/artifact.rb
simple_deploy-0.9.1 lib/simple_deploy/artifact.rb
simple_deploy-0.9.0 lib/simple_deploy/artifact.rb
simple_deploy-0.8.2 lib/simple_deploy/artifact.rb
simple_deploy-0.8.2.beta1 lib/simple_deploy/artifact.rb
simple_deploy-0.8.1.beta1 lib/simple_deploy/artifact.rb
simple_deploy-0.8.0 lib/simple_deploy/artifact.rb
simple_deploy-0.7.8 lib/simple_deploy/artifact.rb
simple_deploy-0.7.7 lib/simple_deploy/artifact.rb
simple_deploy-0.7.7.beta.1 lib/simple_deploy/artifact.rb
simple_deploy-0.7.6 lib/simple_deploy/artifact.rb
simple_deploy-0.7.6.beta.6 lib/simple_deploy/artifact.rb
simple_deploy-0.7.6.beta.5 lib/simple_deploy/artifact.rb
simple_deploy-0.7.6.beta.3 lib/simple_deploy/artifact.rb