You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
489 B
25 lines
489 B
require 'aws-sdk'
|
|
|
|
def main
|
|
bucket = ENV.fetch('CPI_FEED_AWS_BUCKET')
|
|
key = ARGV.first || ENV.fetch('CPI_FEED_AWS_KEY')
|
|
|
|
Aws::S3::Resource.new.bucket(bucket).object(key).put(
|
|
body: $stdin.read
|
|
).on_success do |response|
|
|
puts response.data
|
|
|
|
Aws::S3::Client.new.put_object_acl(
|
|
bucket: bucket, key: key, acl: 'public-read'
|
|
).on_success do |acl_response|
|
|
puts acl_response.data
|
|
end
|
|
|
|
return 0
|
|
end
|
|
|
|
1
|
|
end
|
|
|
|
exit(main) if $PROGRAM_NAME == __FILE__
|