Module: S3
- Defined in:
- lib/modules/s3.rb
Instance Method Summary collapse
- #upload_archived_app(app_zip_path, dsym_zip_path, info_plist_path, bucket_name) ⇒ Object
- #upload_file(file_path, save_path, bucket_name) ⇒ Object
Instance Method Details
#upload_archived_app(app_zip_path, dsym_zip_path, info_plist_path, bucket_name) ⇒ Object
13 14 15 16 17 18 |
# File 'lib/modules/s3.rb', line 13 def upload_archived_app(app_zip_path, dsym_zip_path, info_plist_path, bucket_name) version = application_version(info_plist_path) app_url = upload_file(app_zip_path, File.join(version, File.basename(app_zip_path)), bucket_name) dsym_url = upload_file(dsym_zip_path, File.join(version, File.basename(dsym_zip_path)), bucket_name) return app_url, dsym_url end |
#upload_file(file_path, save_path, bucket_name) ⇒ Object
6 7 8 9 10 11 |
# File 'lib/modules/s3.rb', line 6 def upload_file(file_path, save_path, bucket_name) s3 = Aws::S3::Resource.new(region:'us-west-1' ,endpoint: 'https://s3.amazonaws.com') object = s3.bucket(bucket_name).object(save_path) object.upload_file file_path, acl: 'public-read' return object.public_url end |