Class: Pipely::Build::S3PathBuilder
- Inherits:
-
Object
- Object
- Pipely::Build::S3PathBuilder
- Defined in:
- lib/pipely/build/s3_path_builder.rb
Overview
Builds paths to assets, logs, and steps that are on S3.
Constant Summary collapse
- START_TIME =
"\#{format(@scheduledStartTime,'YYYY-MM-dd_HHmmss')}"
Instance Attribute Summary collapse
-
#assets_bucket ⇒ Object
readonly
Returns the value of attribute assets_bucket.
-
#logs_bucket ⇒ Object
readonly
Returns the value of attribute logs_bucket.
-
#steps_bucket ⇒ Object
readonly
Returns the value of attribute steps_bucket.
Instance Method Summary collapse
- #bucket_relative_s3_asset_prefix ⇒ Object
-
#initialize(options) ⇒ S3PathBuilder
constructor
A new instance of S3PathBuilder.
- #s3_asset_prefix ⇒ Object
- #s3_log_prefix ⇒ Object
- #s3_step_prefix ⇒ Object
- #s3n_asset_prefix ⇒ Object
- #s3n_step_prefix ⇒ Object
- #to_hash ⇒ Object
Constructor Details
#initialize(options) ⇒ S3PathBuilder
Returns a new instance of S3PathBuilder.
12 13 14 15 16 17 |
# File 'lib/pipely/build/s3_path_builder.rb', line 12 def initialize() @assets_bucket = [:assets] @logs_bucket = [:logs] @steps_bucket = [:steps] @s3prefix = [:prefix] end |
Instance Attribute Details
#assets_bucket ⇒ Object (readonly)
Returns the value of attribute assets_bucket.
8 9 10 |
# File 'lib/pipely/build/s3_path_builder.rb', line 8 def assets_bucket @assets_bucket end |
#logs_bucket ⇒ Object (readonly)
Returns the value of attribute logs_bucket.
8 9 10 |
# File 'lib/pipely/build/s3_path_builder.rb', line 8 def logs_bucket @logs_bucket end |
#steps_bucket ⇒ Object (readonly)
Returns the value of attribute steps_bucket.
8 9 10 |
# File 'lib/pipely/build/s3_path_builder.rb', line 8 def steps_bucket @steps_bucket end |
Instance Method Details
#bucket_relative_s3_asset_prefix ⇒ Object
39 40 41 |
# File 'lib/pipely/build/s3_path_builder.rb', line 39 def bucket_relative_s3_asset_prefix "#{@s3prefix}/#{START_TIME}" end |
#s3_asset_prefix ⇒ Object
31 32 33 |
# File 'lib/pipely/build/s3_path_builder.rb', line 31 def s3_asset_prefix "s3://#{@assets_bucket}/#{bucket_relative_s3_asset_prefix}" end |
#s3_log_prefix ⇒ Object
19 20 21 |
# File 'lib/pipely/build/s3_path_builder.rb', line 19 def s3_log_prefix "s3://#{@logs_bucket}/#{@s3prefix}/#{START_TIME}" end |
#s3_step_prefix ⇒ Object
23 24 25 |
# File 'lib/pipely/build/s3_path_builder.rb', line 23 def s3_step_prefix "s3://#{@steps_bucket}/#{@s3prefix}" end |
#s3n_asset_prefix ⇒ Object
35 36 37 |
# File 'lib/pipely/build/s3_path_builder.rb', line 35 def s3n_asset_prefix "s3n://#{@assets_bucket}/#{@s3prefix}/#{START_TIME}" end |
#s3n_step_prefix ⇒ Object
27 28 29 |
# File 'lib/pipely/build/s3_path_builder.rb', line 27 def s3n_step_prefix "s3n://#{@steps_bucket}/#{@s3prefix}" end |
#to_hash ⇒ Object
43 44 45 46 47 48 49 50 51 52 |
# File 'lib/pipely/build/s3_path_builder.rb', line 43 def to_hash { :s3_log_prefix => s3_log_prefix, :s3_step_prefix => s3_step_prefix, :s3n_step_prefix => s3n_step_prefix, :s3_asset_prefix => s3_asset_prefix, :s3n_asset_prefix => s3n_asset_prefix, :bucket_relative_s3_asset_prefix => bucket_relative_s3_asset_prefix, } end |