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')}"- START_DATE =
"\#{format(@scheduledStartTime,'YYYY-MM-dd')}"
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_shared_asset_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.
13 14 15 16 17 18 |
# File 'lib/pipely/build/s3_path_builder.rb', line 13 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
44 45 46 |
# File 'lib/pipely/build/s3_path_builder.rb', line 44 def bucket_relative_s3_asset_prefix "#{@s3prefix}/#{START_TIME}" end |
#s3_asset_prefix ⇒ Object
32 33 34 |
# File 'lib/pipely/build/s3_path_builder.rb', line 32 def s3_asset_prefix "s3://#{@assets_bucket}/#{bucket_relative_s3_asset_prefix}" end |
#s3_log_prefix ⇒ Object
20 21 22 |
# File 'lib/pipely/build/s3_path_builder.rb', line 20 def s3_log_prefix "s3://#{@logs_bucket}/#{@s3prefix}/#{START_TIME}" end |
#s3_shared_asset_prefix ⇒ Object
40 41 42 |
# File 'lib/pipely/build/s3_path_builder.rb', line 40 def s3_shared_asset_prefix "s3://#{@assets_bucket}/#{@s3prefix}/shared/#{START_DATE}" end |
#s3_step_prefix ⇒ Object
24 25 26 |
# File 'lib/pipely/build/s3_path_builder.rb', line 24 def s3_step_prefix "s3://#{@steps_bucket}/#{@s3prefix}" end |
#s3n_asset_prefix ⇒ Object
36 37 38 |
# File 'lib/pipely/build/s3_path_builder.rb', line 36 def s3n_asset_prefix "s3n://#{@assets_bucket}/#{@s3prefix}/#{START_TIME}" end |
#s3n_step_prefix ⇒ Object
28 29 30 |
# File 'lib/pipely/build/s3_path_builder.rb', line 28 def s3n_step_prefix "s3n://#{@steps_bucket}/#{@s3prefix}" end |
#to_hash ⇒ Object
48 49 50 51 52 53 54 55 56 57 58 |
# File 'lib/pipely/build/s3_path_builder.rb', line 48 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, :s3_shared_asset_prefix => s3_shared_asset_prefix, :bucket_relative_s3_asset_prefix => bucket_relative_s3_asset_prefix, } end |