Class: Retag::Service

Inherits:
Object
  • Object
show all
Includes:
Utils
Defined in:
lib/retag/service.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Utils

#cmd!, #dockerauth

Constructor Details

#initialize(name, config, release, branch:, suffix:) ⇒ Service

Returns a new instance of Service.



12
13
14
15
16
17
18
# File 'lib/retag/service.rb', line 12

def initialize(name, config, release, branch:, suffix:)
  @name = name
  @config = config
  @repo = Retag::Repo.new(config['repo'], branch)
  @release = release
  @suffix = suffix
end

Instance Attribute Details

#configObject (readonly)

Returns the value of attribute config.



8
9
10
# File 'lib/retag/service.rb', line 8

def config
  @config
end

#nameObject (readonly)

Returns the value of attribute name.



8
9
10
# File 'lib/retag/service.rb', line 8

def name
  @name
end

#releaseObject (readonly)

Returns the value of attribute release.



8
9
10
# File 'lib/retag/service.rb', line 8

def release
  @release
end

#repoObject (readonly)

Returns the value of attribute repo.



8
9
10
# File 'lib/retag/service.rb', line 8

def repo
  @repo
end

#suffixObject (readonly)

Returns the value of attribute suffix.



8
9
10
# File 'lib/retag/service.rb', line 8

def suffix
  @suffix
end

Instance Method Details

#imagesObject



20
21
22
# File 'lib/retag/service.rb', line 20

def images
  @images ||= config['images'].map{|img| Retag::Image.new(img, revision, suffix: @suffix) }
end