Class: Pipely::Build::Definition
- Inherits:
-
Struct
- Object
- Struct
- Pipely::Build::Definition
- Defined in:
- lib/pipely/build/definition.rb
Overview
Represent a pipeline definition, built from a Template and some config.
Instance Attribute Summary collapse
-
#config ⇒ Object
Returns the value of attribute config.
-
#env ⇒ Object
Returns the value of attribute env.
-
#template ⇒ Object
Returns the value of attribute template.
Instance Method Summary collapse
- #base_filename ⇒ Object
- #pipeline_name ⇒ Object
- #s3_path_builder ⇒ Object
- #s3_prefix ⇒ Object
- #scheduler ⇒ Object
- #to_json ⇒ Object
Instance Attribute Details
#config ⇒ Object
Returns the value of attribute config
6 7 8 |
# File 'lib/pipely/build/definition.rb', line 6 def config @config end |
#env ⇒ Object
Returns the value of attribute env
6 7 8 |
# File 'lib/pipely/build/definition.rb', line 6 def env @env end |
#template ⇒ Object
Returns the value of attribute template
6 7 8 |
# File 'lib/pipely/build/definition.rb', line 6 def template @template end |
Instance Method Details
#base_filename ⇒ Object
11 12 13 |
# File 'lib/pipely/build/definition.rb', line 11 def base_filename config[:namespace] end |
#pipeline_name ⇒ Object
7 8 9 |
# File 'lib/pipely/build/definition.rb', line 7 def pipeline_name config[:name] end |
#s3_path_builder ⇒ Object
24 25 26 |
# File 'lib/pipely/build/definition.rb', line 24 def s3_path_builder S3PathBuilder.new(config[:s3].merge(prefix: s3_prefix)) end |
#s3_prefix ⇒ Object
15 16 17 18 19 20 21 22 |
# File 'lib/pipely/build/definition.rb', line 15 def s3_prefix if config[:s3_prefix] template = Pathology.template(config[:s3_prefix]) template.interpolate(interpolation_context) else fail('unspecified s3_prefix') end end |
#scheduler ⇒ Object
37 38 39 40 41 42 43 44 45 46 |
# File 'lib/pipely/build/definition.rb', line 37 def scheduler case config[:scheduler] when 'daily' DailyScheduler.new(config[:start_time]) when 'now' RightNowScheduler.new else fail('unspecified scheduler') end end |
#to_json ⇒ Object
28 29 30 31 32 33 34 35 |
# File 'lib/pipely/build/definition.rb', line 28 def to_json template.apply_config(:environment => env) template.apply_config(config) template.apply_config(s3_path_builder.to_hash) template.apply_config(scheduler.to_hash) template.to_json end |