Class: UffizziCore::ComposeFile::Builders::TemplateBuilderService

Inherits:
Object
  • Object
show all
Defined in:
app/services/uffizzi_core/compose_file/builders/template_builder_service.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(credentials, project, repositories = []) ⇒ TemplateBuilderService

Returns a new instance of TemplateBuilderService.



6
7
8
9
10
# File 'app/services/uffizzi_core/compose_file/builders/template_builder_service.rb', line 6

def initialize(credentials, project, repositories = [])
  @credentials = credentials
  @project = project
  @repositories = repositories
end

Instance Attribute Details

#credentialsObject

Returns the value of attribute credentials.



4
5
6
# File 'app/services/uffizzi_core/compose_file/builders/template_builder_service.rb', line 4

def credentials
  @credentials
end

#projectObject

Returns the value of attribute project.



4
5
6
# File 'app/services/uffizzi_core/compose_file/builders/template_builder_service.rb', line 4

def project
  @project
end

#repositoriesObject

Returns the value of attribute repositories.



4
5
6
# File 'app/services/uffizzi_core/compose_file/builders/template_builder_service.rb', line 4

def repositories
  @repositories
end

Instance Method Details

#build_attributes(compose_data, compose_dependencies, source) ⇒ Object



12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'app/services/uffizzi_core/compose_file/builders/template_builder_service.rb', line 12

def build_attributes(compose_data, compose_dependencies, source)
  containers_data = compose_data[:containers]
  ingress_data = compose_data[:ingress]
  continuous_preview_global_data = compose_data[:continuous_preview]

  containers_attributes = build_containers_attributes(
    containers_data,
    ingress_data,
    continuous_preview_global_data,
    compose_dependencies,
  )

  {
    name: source,
    payload: {
      containers_attributes: containers_attributes,
    },
  }
end