18 lines
358 B
Ruby
18 lines
358 B
Ruby
require 'aws-sdk'
|
|
|
|
def main
|
|
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'
|
|
)
|
|
0
|
|
end
|
|
|
|
exit(main) if $PROGRAM_NAME == __FILE__
|