Class: Pipely::Build::Definition

Inherits:
Struct
  • Object
show all
Defined in:
lib/pipely/build/definition.rb

Overview

Represent a pipeline definition, built from a Template and some config.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#configObject

Returns the value of attribute config

Returns:

  • (Object)

    the current value of config



6
7
8
# File 'lib/pipely/build/definition.rb', line 6

def config
  @config
end

#envObject

Returns the value of attribute env

Returns:

  • (Object)

    the current value of env



6
7
8
# File 'lib/pipely/build/definition.rb', line 6

def env
  @env
end

#s3_prefixObject

Returns the value of attribute s3_prefix

Returns:

  • (Object)

    the current value of s3_prefix



6
7
8
# File 'lib/pipely/build/definition.rb', line 6

def s3_prefix
  @s3_prefix
end

#schedulerObject

Returns the value of attribute scheduler

Returns:

  • (Object)

    the current value of scheduler



6
7
8
# File 'lib/pipely/build/definition.rb', line 6

def scheduler
  @scheduler
end

#templateObject

Returns the value of attribute template

Returns:

  • (Object)

    the current value of template



6
7
8
# File 'lib/pipely/build/definition.rb', line 6

def template
  @template
end

Instance Method Details

#base_filenameObject



11
12
13
# File 'lib/pipely/build/definition.rb', line 11

def base_filename
  config[:namespace]
end

#pipeline_nameObject



7
8
9
# File 'lib/pipely/build/definition.rb', line 7

def pipeline_name
  config[:name]
end

#s3_path_builderObject



15
16
17
# File 'lib/pipely/build/definition.rb', line 15

def s3_path_builder
  S3PathBuilder.new(config[:s3].merge(prefix: s3_prefix))
end

#to_jsonObject



19
20
21
22
23
24
25
26
# File 'lib/pipely/build/definition.rb', line 19

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