Sha256: 32e460b3e5757eb82b50a9e82c96ae289dd4913908ab8b97b41da4312bb08a11
Contents?: true
Size: 1.03 KB
Versions: 4
Compression:
Stored size: 1.03 KB
Contents
require 'fog' module Stevenson module Deployer class S3 include Deployer::Base attr_reader :deployment_bucket_name, :deployment_key def initialize(options) @deployment_bucket_name, @deployment_key, @deployment_access_key, @deployment_access_secret = options["s3"] super end def deploy!(directory) Dir.glob("#{directory}/**/*").each do |file| s3_bucket.files.create( key: File.join(deployment_key, file.partition(directory).last), body: File.read(file), public: true, ) if File.file?(file) end end private def fog @_fog ||= Fog::Storage.new( provider: 'AWS', aws_access_key_id: @deployment_access_key || ENV["AWS_ACCESS_KEY_ID"], aws_secret_access_key: @deployment_access_secret || ENV["AWS_SECRET_ACCESS_KEY"], ) end def s3_bucket @_s3_bucket = fog.directories.new(key: deployment_bucket_name) end end end end
Version data entries
4 entries across 4 versions & 1 rubygems
Version | Path |
---|---|
stevenson-2.2.2 | lib/stevenson/deployers/s3.rb |
stevenson-2.2.1 | lib/stevenson/deployers/s3.rb |
stevenson-2.2.0 | lib/stevenson/deployers/s3.rb |
stevenson-2.1.0 | lib/stevenson/deployers/s3.rb |