Plop this on S3 already

main
Dan Buch 9 years ago
parent 6bad4fb41f
commit 808cd318ee

2
.gitignore vendored

@ -0,0 +1,2 @@
.*env
*.csv

@ -2,5 +2,7 @@ source 'https://rubygems.org'
ruby '2.2.2' if ENV.key?('DYNO')
gem 'aws-sdk', '~> 2'
gem 'puma'
gem 'pry', group: [:development, :test]
gem 'sinatra'

@ -1,6 +1,21 @@
GEM
remote: https://rubygems.org/
specs:
aws-sdk (2.1.20)
aws-sdk-resources (= 2.1.20)
aws-sdk-core (2.1.20)
jmespath (~> 1.0)
aws-sdk-resources (2.1.20)
aws-sdk-core (= 2.1.20)
coderay (1.1.0)
jmespath (1.0.2)
multi_json (~> 1.0)
method_source (0.8.2)
multi_json (1.11.2)
pry (0.10.1)
coderay (~> 1.1.0)
method_source (~> 0.8.1)
slop (~> 3.4)
puma (2.13.4)
rack (1.6.4)
rack-protection (1.5.3)
@ -9,12 +24,15 @@ GEM
rack (~> 1.4)
rack-protection (~> 1.4)
tilt (>= 1.3, < 3)
slop (3.6.0)
tilt (2.0.1)
PLATFORMS
ruby
DEPENDENCIES
aws-sdk (~> 2)
pry
puma
sinatra

@ -0,0 +1,12 @@
require 'aws-sdk'
bucket = ENV.fetch('CPI_FEED_AWS_BUCKET')
key = ARGV.first || ENV.fetch('CPI_FEED_AWS_KEY')
puts Aws::S3::Resource.new.bucket(bucket).object(key).put(
body: $stdin.read
)
puts Aws::S3::Client.new.put_object_acl(
bucket: bucket, key: key, acl: 'public-read'
)
Loading…
Cancel
Save