Class: Lono::AppFile::Upload
- Inherits:
-
Base
- Object
- Lono::AbstractBase
- Base
- Lono::AppFile::Upload
- Extended by:
- Memoist
- Includes:
- Lono::AwsServices
- Defined in:
- lib/lono/app_file/upload.rb
Instance Method Summary collapse
- #s3_bucket ⇒ Object
-
#s3_upload(item) ⇒ Object
TODO: check md5sum and only upload if it changes.
- #upload ⇒ Object
Methods included from Lono::AwsServices
#cfn, #ec2, #iam, #s3, #s3_presigner, #s3_resource, #sts
Methods included from Lono::AwsServices::Helper
#rollback_complete?, #testing_update?
Methods included from Lono::AwsServices::StackSet
#find_stack_set, #stack_set_exists?
Methods included from Lono::AwsServices::Stack
Methods inherited from Base
#initialize, #initialize_variables
Methods inherited from Lono::AbstractBase
#initialize, #reinitialize, #template_path
Methods included from Blueprint::Root
#find_blueprint_root, #set_blueprint_root
Constructor Details
This class inherits a constructor from Lono::AppFile::Base
Instance Method Details
#s3_bucket ⇒ Object
32 33 34 |
# File 'lib/lono/app_file/upload.rb', line 32 def s3_bucket Lono::S3::Bucket.name end |
#s3_upload(item) ⇒ Object
TODO: check md5sum and only upload if it changes
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/lono/app_file/upload.rb', line 16 def s3_upload(item) filepath = item.zip_file_path s3_key = item.s3_path s3_path = "s3://#{s3_bucket}/#{s3_key}" = "Uploading: #{filepath} to #{s3_path}".color(:green) = "NOOP: #{}" if @options[:noop] puts return if @options[:noop] s3.put_object( body: IO.read(filepath), bucket: s3_bucket, key: s3_key, ) end |