Method: Menu::Release#upload_payload

Defined in:
lib/menu/release.rb

#upload_payloadObject



11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/menu/release.rb', line 11

def upload_payload
  s3 = Aws::S3::Client.new(region: 'us-east-1')
  key = "#{options.component}/v#{self.version}-#{@md5}#{File.extname(@payload_file)}"
  puts "Uploading payload (#{key}) to S3..." if @options.verbose
  s3.put_object(
    acl: "public-read",
    body: File.open(@payload_file),
    bucket: @options.bucket,
    key: key
  )
  puts "Upload complete." if @options.verbose
  self.payload = ENV['MENU_SSL_URL'] + '/' + key
end