Class: Minos::Artifact

Inherits:
Object
  • Object
show all
Includes:
Dry::Monads::List::Mixin, Dry::Monads::Result::Mixin, Dry::Monads::Task::Mixin, Dry::Monads::Try::Mixin, Thor::Shell
Defined in:
lib/minos/artifact.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(artifact, options: {}) ⇒ Artifact

Returns a new instance of Artifact.



18
19
20
21
# File 'lib/minos/artifact.rb', line 18

def initialize(artifact, options: {})
  @artifact = artifact
  @options = options
end

Instance Attribute Details

#artifactObject (readonly)

Returns the value of attribute artifact.



16
17
18
# File 'lib/minos/artifact.rb', line 16

def artifact
  @artifact
end

#optionsObject (readonly)

Returns the value of attribute options.



16
17
18
# File 'lib/minos/artifact.rb', line 16

def options
  @options
end

Instance Method Details

#buildObject



27
28
29
# File 'lib/minos/artifact.rb', line 27

def build
  docker_build.to_result
end

#nameObject



23
24
25
# File 'lib/minos/artifact.rb', line 23

def name
  artifact['name']
end

#push {|List::Task[ *tags.map.each_with_index { |tag, i| docker_push(i, tag) } ] .traverse .to_result| ... } ⇒ Object

Yields:

  • (List::Task[ *tags.map.each_with_index { |tag, i| docker_push(i, tag) } ] .traverse .to_result)


31
32
33
34
35
36
37
# File 'lib/minos/artifact.rb', line 31

def push
  yield List::Task[
    *tags.map.each_with_index { |tag, i| docker_push(i, tag) }
  ]
  .traverse
  .to_result
end