Sha256: d54db5ca4f5f91698675d6c562c113d92f70339346942fb60241162d17c48c0e

Contents?: true

Size: 884 Bytes

Versions: 6

Compression:

Stored size: 884 Bytes

Contents

require 'kconv'

module DPL
  class Provider
    class GCS < Provider
      requires 'gstore'
      experimental 'Google Cloud Storage'

      def needs_key?
        false
      end

      def client
        @client ||= GStore::Client.new(
          :access_key => option(:access_key_id),
          :secret_key => option(:secret_access_key)
        )
      end

      def check_auth
        log "Logging in with Access Key: #{option(:access_key_id)[-4..-1].rjust(20, '*')}"
      end

      def push_app
        Dir.chdir(options.fetch(:local_dir, Dir.pwd)) do
          Dir.glob("**/*") do |filename|
            next if File.directory?(filename)

            log "Push: #{filename}"

            client.put_object(
              option(:bucket),
              filename,
              :data => File.read(filename)
            )
          end
        end
      end

    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
dpl-1.6.5 lib/dpl/provider/gcs.rb
dpl-1.6.6.travis.478.1 lib/dpl/provider/gcs.rb
dpl-1.6.5.travis.477.1 lib/dpl/provider/gcs.rb
dpl-1.6.5.travis.470.1 lib/dpl/provider/gcs.rb
dpl-1.6.5.travis.468.1 lib/dpl/provider/gcs.rb
dpl-1.6.5.travis.466.1 lib/dpl/provider/gcs.rb